Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
5dc3b37b
Commit
5dc3b37b
authored
Feb 07, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use described_class over literal class name
parent
8116e400
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
spec/finders/environments_finder_spec.rb
spec/finders/environments_finder_spec.rb
+11
-11
No files found.
spec/finders/environments_finder_spec.rb
View file @
5dc3b37b
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment