BigW Consortium Gitlab

Commit 329d535b by Dylan Griffith

Add extra spec for Project#any_runners? to test block properly

parent ff219759
...@@ -1165,6 +1165,11 @@ describe Project do ...@@ -1165,6 +1165,11 @@ describe Project do
project.runners << specific_runner project.runners << specific_runner
expect(project.any_runners? { |runner| runner == specific_runner }).to be_truthy expect(project.any_runners? { |runner| runner == specific_runner }).to be_truthy
end end
it 'returns false if match cannot be found' do
project.runners << specific_runner
expect(project.any_runners? { false }).to be_falsey
end
end end
context 'for shared runners enabled' do context 'for shared runners enabled' do
...@@ -1179,6 +1184,11 @@ describe Project do ...@@ -1179,6 +1184,11 @@ describe Project do
shared_runner shared_runner
expect(project.any_runners? { |runner| runner == shared_runner }).to be_truthy expect(project.any_runners? { |runner| runner == shared_runner }).to be_truthy
end end
it 'returns false if match cannot be found' do
shared_runner
expect(project.any_runners? { false }).to be_falsey
end
end end
end end
...@@ -1212,6 +1222,11 @@ describe Project do ...@@ -1212,6 +1222,11 @@ describe Project do
group_runner group_runner
expect(project.any_runners? { |runner| runner == group_runner }).to be_truthy expect(project.any_runners? { |runner| runner == group_runner }).to be_truthy
end end
it 'returns false if match cannot be found' do
group_runner
expect(project.any_runners? { false }).to be_falsey
end
end end
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