Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (32 sloc) 1.073 kb
require "spec_helper"
describe "failed_results_re for autotest" do
let(:output) { StringIO.new }
let(:formatter) { RSpec::Core::Formatters::BaseTextFormatter.new(output) }
let(:example_output) do
group = RSpec::Core::ExampleGroup.describe("group name")
group.example("example name") { "this".should eq("that") }
group.run(formatter)
formatter.dump_failures
output.string
end
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
Jump to Line
Something went wrong with that request. Please try again.