Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
get some new colorization specs passing whether run with rake or auto…
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
dchelimsky committed Sep 24, 2009
1 parent 081ccf5 commit cb60e74
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions spec/spec/runner/formatter/progress_bar_formatter_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit cb60e74

Please sign in to comment.