Skip to content

Commit

Permalink
rubocop -A
Browse files Browse the repository at this point in the history
  • Loading branch information
pandeiro245 committed Dec 1, 2024
1 parent bb4799d commit d308576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions app/models/prompt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def rspec_result
return 'RSpec実行結果はまだ生成されていません。script/run_rspec.shを実行してください。' unless File.exist?(RSPEC_RESULT_PATH)

# ファイルの更新時刻を確認
file_age = Time.now - File.mtime(RSPEC_RESULT_PATH)
file_age = Time.zone.now - File.mtime(RSPEC_RESULT_PATH)
return "RSpec実行結果が1時間以上前のものです。新しい結果を取得するにはscript/run_rspec.shを実行してください。\n\n#{File.read(RSPEC_RESULT_PATH)}" if file_age > 1.hour

# 結果ファイルを読み取って返す
Expand All @@ -23,14 +23,14 @@ def spec_codes
hash = {}
spec_paths = [
# テストファイル
Dir.glob(Rails.root.join('spec/**/*_spec.rb')),
Rails.root.glob('spec/**/*_spec.rb'),
# ヘルパーファイル
Dir.glob(Rails.root.join('spec/rails_helper.rb')),
Dir.glob(Rails.root.join('spec/spec_helper.rb')),
Rails.root.glob('spec/rails_helper.rb'),
Rails.root.glob('spec/spec_helper.rb'),
# ファクトリーファイル
Dir.glob(Rails.root.join('spec/factories/*.rb')),
Rails.root.glob('spec/factories/*.rb'),
# サポートファイル
Dir.glob(Rails.root.join('spec/support/*.rb')),
Rails.root.glob('spec/support/*.rb'),
].flatten

spec_paths.each do |path|
Expand Down
2 changes: 1 addition & 1 deletion spec/models/workload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
it '何も更新されない' do
expect do
described_class.recalculate_numbers_for_user(user.id, start_date: '2024-01-01', end_date: '2024-01-02')
end.not_to(change { Workload.count })
end.not_to(change(Workload, :count))
end
end
end
Expand Down

0 comments on commit d308576

Please sign in to comment.