summaryrefslogtreecommitdiff
path: root/qa/spec/spec_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/spec_helper_spec.rb')
-rw-r--r--qa/spec/spec_helper_spec.rb134
1 files changed, 67 insertions, 67 deletions
diff --git a/qa/spec/spec_helper_spec.rb b/qa/spec/spec_helper_spec.rb
index 27ec1ec80fe..dfa3a8450de 100644
--- a/qa/spec/spec_helper_spec.rb
+++ b/qa/spec/spec_helper_spec.rb
@@ -1,29 +1,29 @@
# frozen_string_literal: true
-describe 'rspec config tests' do
+describe "rspec config tests" do
let(:group) do
RSpec.describe do
- shared_examples 'passing tests' do
- example 'not in quarantine' do
+ shared_examples "passing tests" do
+ example "not in quarantine" do
end
- example 'in quarantine', :quarantine do
+ example "in quarantine", :quarantine do
end
end
- context 'default' do
- it_behaves_like 'passing tests'
+ context "default" do
+ it_behaves_like "passing tests"
end
- context 'foo', :foo do
- it_behaves_like 'passing tests'
+ context "foo", :foo do
+ it_behaves_like "passing tests"
end
- context 'quarantine', :quarantine do
- it_behaves_like 'passing tests'
+ context "quarantine", :quarantine do
+ it_behaves_like "passing tests"
end
- context 'bar quarantine', :bar, :quarantine do
- it_behaves_like 'passing tests'
+ context "bar quarantine", :bar, :quarantine do
+ it_behaves_like "passing tests"
end
end
end
@@ -34,23 +34,23 @@ describe 'rspec config tests' do
@expectations = [1, 2, 3]
end
- example 'not in quarantine' do
+ example "not in quarantine" do
expect(@expectations.shift).to be(3)
end
- example 'in quarantine', :quarantine do
+ example "in quarantine", :quarantine do
expect(@expectations.shift).to be(3)
end
end
end
- context 'with no tags focussed' do
+ context "with no tags focussed" do
before do
group.run
end
- context 'in a context tagged :foo' do
- it 'skips tests in quarantine' do
+ context "in a context tagged :foo" do
+ it "skips tests in quarantine" do
context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(2)
@@ -60,12 +60,12 @@ describe 'rspec config tests' do
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('In quarantine')
+ expect(ex.execution_result.pending_message).to eq("In quarantine")
end
end
- context 'in an untagged context' do
- it 'skips tests in quarantine' do
+ context "in an untagged context" do
+ it "skips tests in quarantine" do
context = group.children.find { |c| c.description == "default" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(2)
@@ -75,12 +75,12 @@ describe 'rspec config tests' do
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('In quarantine')
+ expect(ex.execution_result.pending_message).to eq("In quarantine")
end
end
- context 'in a context tagged :quarantine' do
- it 'skips all tests' do
+ context "in a context tagged :quarantine" do
+ it "skips all tests" do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(2)
@@ -90,12 +90,12 @@ describe 'rspec config tests' do
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('In quarantine')
+ expect(ex.execution_result.pending_message).to eq("In quarantine")
end
end
end
- context 'with :quarantine focussed' do
+ context "with :quarantine focussed" do
before do
RSpec.configure do |config|
config.inclusion_filter = :quarantine
@@ -109,8 +109,8 @@ describe 'rspec config tests' do
end
end
- context 'in an untagged context' do
- it 'only runs quarantined tests' do
+ context "in an untagged context" do
+ it "only runs quarantined tests" do
context = group.children.find { |c| c.description == "default" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(1)
@@ -120,8 +120,8 @@ describe 'rspec config tests' do
end
end
- context 'in a context tagged :foo' do
- it 'only runs quarantined tests' do
+ context "in a context tagged :foo" do
+ it "only runs quarantined tests" do
context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(1)
@@ -131,8 +131,8 @@ describe 'rspec config tests' do
end
end
- context 'in a context tagged :quarantine' do
- it 'runs all tests' do
+ context "in a context tagged :quarantine" do
+ it "runs all tests" do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -146,7 +146,7 @@ describe 'rspec config tests' do
end
end
- context 'with a non-quarantine tag (:foo) focussed' do
+ context "with a non-quarantine tag (:foo) focussed" do
before do
RSpec.configure do |config|
config.inclusion_filter = :foo
@@ -160,15 +160,15 @@ describe 'rspec config tests' do
end
end
- context 'in an untagged context' do
- it 'runs no tests' do
+ context "in an untagged context" do
+ it "runs no tests" do
context = group.children.find { |c| c.description == "default" }
expect(context.descendant_filtered_examples.count).to eq(0)
end
end
- context 'in a context tagged :foo' do
- it 'skips quarantined tests' do
+ context "in a context tagged :foo" do
+ it "skips quarantined tests" do
context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -178,22 +178,22 @@ describe 'rspec config tests' do
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('In quarantine')
+ expect(ex.execution_result.pending_message).to eq("In quarantine")
end
end
- context 'in a context tagged :quarantine' do
- it 'runs no tests' do
+ context "in a context tagged :quarantine" do
+ it "runs no tests" do
context = group.children.find { |c| c.description == "quarantine" }
expect(context.descendant_filtered_examples.count).to eq(0)
end
end
end
- context 'with :quarantine and a non-quarantine tag (:foo) focussed' do
+ context "with :quarantine and a non-quarantine tag (:foo) focussed" do
before do
RSpec.configure do |config|
- config.inclusion_filter = { quarantine: true, foo: true }
+ config.inclusion_filter = {quarantine: true, foo: true}
end
group.run
@@ -204,8 +204,8 @@ describe 'rspec config tests' do
end
end
- context 'in an untagged context' do
- it 'ignores untagged tests and skips tests even if in quarantine' do
+ context "in an untagged context" do
+ it "ignores untagged tests and skips tests even if in quarantine" do
context = group.children.find { |c| c.description == "default" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(1)
@@ -215,8 +215,8 @@ describe 'rspec config tests' do
end
end
- context 'in a context tagged :foo' do
- it 'only runs quarantined tests' do
+ context "in a context tagged :foo" do
+ it "only runs quarantined tests" do
context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -229,8 +229,8 @@ describe 'rspec config tests' do
end
end
- context 'in a context tagged :quarantine' do
- it 'skips all tests' do
+ context "in a context tagged :quarantine" do
+ it "skips all tests" do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -243,8 +243,8 @@ describe 'rspec config tests' do
end
end
- context 'in a context tagged :bar and :quarantine' do
- it 'skips all tests' do
+ context "in a context tagged :bar and :quarantine" do
+ it "skips all tests" do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -258,10 +258,10 @@ describe 'rspec config tests' do
end
end
- context 'with :quarantine and multiple non-quarantine tags focussed' do
+ context "with :quarantine and multiple non-quarantine tags focussed" do
before do
RSpec.configure do |config|
- config.inclusion_filter = { bar: true, foo: true, quarantine: true }
+ config.inclusion_filter = {bar: true, foo: true, quarantine: true}
end
group.run
@@ -272,8 +272,8 @@ describe 'rspec config tests' do
end
end
- context 'in a context tagged :foo' do
- it 'only runs quarantined tests' do
+ context "in a context tagged :foo" do
+ it "only runs quarantined tests" do
context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -283,28 +283,28 @@ describe 'rspec config tests' do
ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('Only running tests tagged with :quarantine and any of [:bar, :foo]')
+ expect(ex.execution_result.pending_message).to eq("Only running tests tagged with :quarantine and any of [:bar, :foo]")
end
end
- context 'in a context tagged :quarantine' do
- it 'skips all tests' do
+ context "in a context tagged :quarantine" do
+ it "skips all tests" do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('Only running tests tagged with :quarantine and any of [:bar, :foo]')
+ expect(ex.execution_result.pending_message).to eq("Only running tests tagged with :quarantine and any of [:bar, :foo]")
ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
- expect(ex.execution_result.pending_message).to eq('Only running tests tagged with :quarantine and any of [:bar, :foo]')
+ expect(ex.execution_result.pending_message).to eq("Only running tests tagged with :quarantine and any of [:bar, :foo]")
end
end
- context 'in a context tagged :bar and :quarantine' do
- it 'runs all tests' do
+ context "in a context tagged :bar and :quarantine" do
+ it "runs all tests" do
context = group.children.find { |c| c.description == "bar quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
@@ -318,20 +318,20 @@ describe 'rspec config tests' do
end
end
- context 'rspec retry' do
- context 'in an untagged context' do
+ context "rspec retry" do
+ context "in an untagged context" do
before do
group_2.run
end
- it 'should run example :retry times' do
+ it "should run example :retry times" do
examples = group_2.descendant_filtered_examples
- ex = examples.find { |e| e.description == 'not in quarantine' }
+ ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed)
end
end
- context 'with :quarantine focussed' do
+ context "with :quarantine focussed" do
before do
RSpec.configure do |config|
config.inclusion_filter = :quarantine
@@ -345,9 +345,9 @@ describe 'rspec config tests' do
end
end
- it 'should run example once only' do
+ it "should run example once only" do
examples = group_2.descendant_filtered_examples
- ex = examples.find { |e| e.description == 'in quarantine' }
+ ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:failed)
end
end