spec/formatter_spec.rb in konacha-3.2.3 vs spec/formatter_spec.rb in konacha-3.2.4
- old
+ new
@@ -7,14 +7,21 @@
shared_examples "test result" do |method, dot|
it "stores the example in the examples array" do
subject.send(method, nil)
subject.examples.should be_present
end
-
+
it "outputs the dot" do
subject.send(method, nil)
io.rewind
- io.read.should include(dot)
+ io.read.should eql(dot)
+ end
+
+ it "uses colors when tty" do
+ io.stub(:tty?).and_return(true)
+ subject.send(method, nil)
+ io.rewind
+ io.read.should match(/\e\[0;\d{2};49m#{dot}\e\[0m/)
end
end
describe "#example_passed" do
it_behaves_like "test result", :example_passed, "."