Skip to content

Commit ac3ee59

Browse files
committed
Switch to constants instead of lets
1 parent 7a16e59 commit ac3ee59

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

spec/integration/rails_5.2.4.1_spec.rb

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,23 @@
44
require_relative 'integration_helper'
55

66
describe 'Integration testing on Rails 5.2.4.1', if: IntegrationHelper.able_to_run?(__FILE__, RUBY_VERSION) do
7-
let(:app_name) { 'rails_5.2.4.1' }
7+
::APP_NAME = 'rails_5.2.4.1'.freeze
8+
::PROJECT_PATH = File.expand_path('../..', __dir__)
9+
::APP_PATH = File.expand_path(APP_NAME, __dir__)
10+
::MIGRATION_COMMAND = 'bin/rails db:migrate'.freeze
811

9-
let(:project_path) { File.expand_path('../..', __dir__) }
10-
let!(:app_path) { File.expand_path(app_name, __dir__) }
12+
let!(:git) { Git.open(PROJECT_PATH) }
1113

12-
let!(:git) { Git.open(project_path) }
13-
14-
let(:migration_command) { 'bin/rails db:migrate' }
15-
16-
before do
14+
before(:all) do
1715
Bundler.with_clean_env do
18-
Dir.chdir app_path do
16+
Dir.chdir APP_PATH do
1917
puts `bundle install`
20-
puts `#{migration_command}`
18+
puts `#{MIGRATION_COMMAND}`
2119
end
2220
end
2321
end
2422

25-
after do
23+
after(:each) do
2624
git.reset_hard
2725
end
2826

@@ -95,7 +93,7 @@
9593

9694
it 'annotate models' do
9795
Bundler.with_clean_env do
98-
Dir.chdir app_path do
96+
Dir.chdir APP_PATH do
9997
expect(git.diff.any?).to be_falsy
10098

10199
puts `#{command}`
@@ -145,14 +143,12 @@
145143

146144
it 'annotate routes.rb' do
147145
Bundler.with_clean_env do
148-
Dir.chdir app_path do
146+
Dir.chdir APP_PATH do
149147
expect(git.diff.any?).to be_falsy
150148

151149
puts `#{command}`
152150

153-
expect(git.diff.entries).to include(
154-
an_object_having_attributes(task_routes)
155-
)
151+
expect(git.diff.entries).to include(an_object_having_attributes(task_routes))
156152
end
157153
end
158154
end

0 commit comments

Comments
 (0)