Permalink
Browse files

get some new colorization specs passing whether run with rake or auto…

…test
  • Loading branch information...
1 parent 081ccf5 commit cb60e7489a67416ca317b3f0ea6f01baea96cda9 @dchelimsky dchelimsky committed Sep 24, 2009
Showing with 12 additions and 8 deletions.
  1. +12 −8 spec/spec/runner/formatter/progress_bar_formatter_spec.rb
View
20 spec/spec/runner/formatter/progress_bar_formatter_spec.rb
@@ -45,29 +45,33 @@ module Formatter
end
it "should push green dot for passing spec" do
- @io.should_receive(:tty?).and_return(true)
- @options.should_receive(:colour).and_return(true)
+ @formatter.stub(:output_to_file?) {false}
+ @io.stub(:tty?) {true}
+ @options.stub(:colour) {true}
@formatter.example_passed("spec")
@io.string.should == "\e[32m.\e[0m"
end
it "should push red F for failure spec" do
- @io.should_receive(:tty?).and_return(true)
- @options.should_receive(:colour).and_return(true)
+ @formatter.stub(:output_to_file?) {false}
+ @io.stub(:tty?) {true}
+ @options.stub(:colour) {true}
@formatter.example_failed("spec", 98, Spec::Runner::Reporter::Failure.new("g", "c s", Spec::Expectations::ExpectationNotMetError.new))
@io.string.should eql("\e[31mF\e[0m")
end
it "should push red F for error spec" do
- @io.should_receive(:tty?).and_return(true)
- @options.should_receive(:colour).and_return(true)
+ @formatter.stub(:output_to_file?) {false}
+ @io.stub(:tty?) {true}
+ @options.stub(:colour) {true}
@formatter.example_failed("spec", 98, Spec::Runner::Reporter::Failure.new("g", "c s", RuntimeError.new))
@io.string.should eql("\e[31mF\e[0m")
end
it "should push blue F for fixed pending spec" do
- @io.should_receive(:tty?).and_return(true)
- @options.should_receive(:colour).and_return(true)
+ @formatter.stub(:output_to_file?) {false}
+ @io.stub(:tty?) {true}
+ @options.stub(:colour) {true}
@formatter.example_failed("spec", 98, Spec::Runner::Reporter::Failure.new("g", "c s", Spec::Example::PendingExampleFixedError.new))
@io.string.should eql("\e[34mF\e[0m")
end

0 comments on commit cb60e74

Please sign in to comment.