Skip to content
Browse files

spec proving that the existing regexp doesn't match out when colour i…

…s enabled
  • Loading branch information...
1 parent 1bf1edf commit 79076fd199332cd186710f5481acf7716a22c2d1 @JonRowe JonRowe committed Jan 23, 2011
Showing with 22 additions and 5 deletions.
  1. +22 −5 spec/autotest/failed_results_re_spec.rb
View
27 spec/autotest/failed_results_re_spec.rb
@@ -7,14 +7,31 @@
group = RSpec::Core::ExampleGroup.describe("group name")
group.example("example name") { "this".should eq("that") }
group.run(formatter)
- RSpec.configuration.stub(:color_enabled?) { false }
formatter.dump_failures
output.string
end
- it "matches a failure" do
- re = Autotest::Rspec2.new.failed_results_re
- example_output.should =~ re
- example_output[re, 2].should == __FILE__.sub(File.expand_path('.'),'.')
+ context "output does not have color enabled" do
+ before do
+ RSpec.configuration.stub(:color_enabled?) { false }
+ end
+
+ it "matches a failure" do
+ re = Autotest::Rspec2.new.failed_results_re
+ example_output.should =~ re
+ example_output[re, 2].should == __FILE__.sub(File.expand_path('.'),'.')
+ end
+ end
+
+ context "output has color enabled" do
+ before do
+ RSpec.configuration.stub(:color_enabled?) { true }
+ end
+
+ it "matches a failure" do
+ re = Autotest::Rspec2.new.failed_results_re
+ example_output.should =~ re
+ example_output[re, 2].should == __FILE__.sub(File.expand_path('.'),'.')
+ end
end
end

0 comments on commit 79076fd

Please sign in to comment.
Something went wrong with that request. Please try again.