Commit 5dc3b37b authored by Douwe Maan's avatar Douwe Maan

Use described_class over literal class name

parent 8116e400
...@@ -16,17 +16,17 @@ describe EnvironmentsFinder do ...@@ -16,17 +16,17 @@ describe EnvironmentsFinder do
end end
it 'returns environment when with_tags is set' do it 'returns environment when with_tags is set' do
expect(EnvironmentsFinder.new(project, user, ref: 'master', commit: project.commit, with_tags: true).execute) expect(described_class.new(project, user, ref: 'master', commit: project.commit, with_tags: true).execute)
.to contain_exactly(environment) .to contain_exactly(environment)
end end
it 'does not return environment when no with_tags is set' do it 'does not return environment when no with_tags is set' do
expect(EnvironmentsFinder.new(project, user, ref: 'master', commit: project.commit).execute) expect(described_class.new(project, user, ref: 'master', commit: project.commit).execute)
.to be_empty .to be_empty
end end
it 'does not return environment when commit is not part of deployment' do it 'does not return environment when commit is not part of deployment' do
expect(EnvironmentsFinder.new(project, user, ref: 'master', commit: project.commit('feature')).execute) expect(described_class.new(project, user, ref: 'master', commit: project.commit('feature')).execute)
.to be_empty .to be_empty
end end
end end
...@@ -37,22 +37,22 @@ describe EnvironmentsFinder do ...@@ -37,22 +37,22 @@ describe EnvironmentsFinder do
end end
it 'returns environment when ref is set' do it 'returns environment when ref is set' do
expect(EnvironmentsFinder.new(project, user, ref: 'master', commit: project.commit).execute) expect(described_class.new(project, user, ref: 'master', commit: project.commit).execute)
.to contain_exactly(environment) .to contain_exactly(environment)
end end
it 'does not environment when ref is different' do it 'does not environment when ref is different' do
expect(EnvironmentsFinder.new(project, user, ref: 'feature', commit: project.commit).execute) expect(described_class.new(project, user, ref: 'feature', commit: project.commit).execute)
.to be_empty .to be_empty
end end
it 'does not return environment when commit is not part of deployment' do it 'does not return environment when commit is not part of deployment' do
expect(EnvironmentsFinder.new(project, user, ref: 'master', commit: project.commit('feature')).execute) expect(described_class.new(project, user, ref: 'master', commit: project.commit('feature')).execute)
.to be_empty .to be_empty
end end
it 'returns environment when commit constraint is not set' do it 'returns environment when commit constraint is not set' do
expect(EnvironmentsFinder.new(project, user, ref: 'master').execute) expect(described_class.new(project, user, ref: 'master').execute)
.to contain_exactly(environment) .to contain_exactly(environment)
end end
end end
...@@ -63,7 +63,7 @@ describe EnvironmentsFinder do ...@@ -63,7 +63,7 @@ describe EnvironmentsFinder do
end end
it 'returns environment' do it 'returns environment' do
expect(EnvironmentsFinder.new(project, user, commit: project.commit).execute) expect(described_class.new(project, user, commit: project.commit).execute)
.to contain_exactly(environment) .to contain_exactly(environment)
end end
end end
...@@ -75,7 +75,7 @@ describe EnvironmentsFinder do ...@@ -75,7 +75,7 @@ describe EnvironmentsFinder do
end end
it 'finds recently updated environment' do it 'finds recently updated environment' do
expect(EnvironmentsFinder.new(project, user, ref: 'feature', recently_updated: true).execute) expect(described_class.new(project, user, ref: 'feature', recently_updated: true).execute)
.to contain_exactly(environment) .to contain_exactly(environment)
end end
end end
...@@ -87,7 +87,7 @@ describe EnvironmentsFinder do ...@@ -87,7 +87,7 @@ describe EnvironmentsFinder do
end end
it 'does not find environment' do it 'does not find environment' do
expect(EnvironmentsFinder.new(project, user, ref: 'feature', recently_updated: true).execute) expect(described_class.new(project, user, ref: 'feature', recently_updated: true).execute)
.to be_empty .to be_empty
end end
end end
...@@ -101,7 +101,7 @@ describe EnvironmentsFinder do ...@@ -101,7 +101,7 @@ describe EnvironmentsFinder do
end end
it 'finds both environments' do it 'finds both environments' do
expect(EnvironmentsFinder.new(project, user, ref: 'feature', recently_updated: true).execute) expect(described_class.new(project, user, ref: 'feature', recently_updated: true).execute)
.to contain_exactly(environment, second_environment) .to contain_exactly(environment, second_environment)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment