From 2b2468ef4a933236d4017fb7b758915964321084 Mon Sep 17 00:00:00 2001 From: Myron Marston Date: Thu, 6 Feb 2014 18:34:48 -0800 Subject: [PATCH] Add some regression tests for some popular custom formatter gems. For #1291. --- cucumber.yml | 2 +- features/formatters/regression_tests.feature | 80 +++++++++++++++++++ .../step_definitions/additional_cli_steps.rb | 4 + rspec-core.gemspec | 8 +- 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 features/formatters/regression_tests.feature diff --git a/cucumber.yml b/cucumber.yml index bb0b8cf01d..e37a8bcc15 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -3,4 +3,4 @@ exclusions = [] exclusions << ' --tags ~@no-jruby' if RUBY_PLATFORM == 'java' %> default: --require features --strict --format progress --tags ~@wip<%= exclusions.join %> features -wip: --require features --tags @wip:3 --wip features +wip: --require features --tags @wip:30 --wip features diff --git a/features/formatters/regression_tests.feature b/features/formatters/regression_tests.feature new file mode 100644 index 0000000000..7533d9fede --- /dev/null +++ b/features/formatters/regression_tests.feature @@ -0,0 +1,80 @@ +Feature: Regression tests for legacy custom formatters + + Background: + Given a file named "spec/passing_and_failing_spec.rb" with: + """ruby + RSpec.describe "Some examples" do + it "passes" do + expect(1).to eq(1) + end + + it "fails" do + expect(1).to eq(2) + end + + context "nested" do + it "passes" do + expect(1).to eq(1) + end + + it "fails" do + expect(1).to eq(2) + end + end + end + """ + And a file named "spec/pending_spec.rb" with: + """ruby + RSpec.describe "Some pending examples" do + context "pending" do + it "is reported as pending" do + pending { expect(1).to eq(2) } + end + + it "is reported as failing" do + pending { expect(1).to eq(1) } + end + end + end + """ + + @wip @announce + Scenario: Use fuubar formatter + When I run `rspec --format Fuubar` + Then the output should contain "Progress: |============" + And the output should contain "6 examples, 3 failures, 1 pending" + And the output should contain "The Fuubar formatter uses the deprecated formatter interface" + But the output should not contain any error backtraces + + Scenario: Use rspec-instafail formatter + When I run `rspec --format RSpec::Instafail` + Then the output should contain "6 examples, 3 failures, 1 pending" + And the output should contain "The RSpec::Instafail formatter uses the deprecated formatter interface" + But the output should not contain any error backtraces + + Scenario: Use rspec-extra-formatters JUnit formatter + When I run `rspec --require rspec-extra-formatters --format JUnitFormatter` + Then the output should contain: + """ + 1.0.9" - s.add_development_dependency "mocha", "~> 0.13.0" s.add_development_dependency "rr", "~> 1.0.4" s.add_development_dependency "flexmock", "~> 0.9.0" + + # For legacy custom formatter regression tests + s.add_development_dependency "fuubar", "1.3.2" + s.add_development_dependency "nyan-cat-formatter", "0.5.2" + s.add_development_dependency "rspec-instafail", "0.2.4" + s.add_development_dependency "rspec_spinner", "2.0.0" + s.add_development_dependency "rspec-extra-formatters", "1.0.0" end