Skip to content

Commit

Permalink
Test that omitting the no_color option will allow colors to be printed.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Jun 30, 2014
1 parent 917d080 commit 415b1de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/synx/tabber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@

it "should not print anything if quiet is true" do
Synx::Tabber.options = { quiet: true }
Synx::Tabber.increase(3)
expect(Kernel).to_not receive(:puts)
Synx::Tabber.puts("Hello, world.")
end

it "should print colors if no_color is false or not present" do
expect(Kernel).to receive(:puts).with("\e[0;31;49mHello, world.\e[0m")
Synx::Tabber.puts("Hello, world.".red)
end

it "should not print colors if no_color is true" do
Synx::Tabber.options = { no_color: true }
expect(Kernel).to receive(:puts).with("Hello, world.")
Expand Down

0 comments on commit 415b1de

Please sign in to comment.