Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Expose AnsiEscapes methods on the class level as well, for easy calling without inclusion #161

Merged
merged 1 commit into from
Feb 8, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/gherkin/formatter/ansi_escapes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def reset
def up(n)
"\e[#{n}A"
end

extend self
end
end
end
25 changes: 19 additions & 6 deletions spec/gherkin/formatter/ansi_escapes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@
module Gherkin
module Formatter
describe AnsiEscapes do
include Gherkin::Formatter::AnsiEscapes
describe "instance methods" do
include AnsiEscapes

it "failed should be red" do
failed.should == "\e[31m"
end
it "failed should be red" do
failed.should == "\e[31m"
end

it "failed arg should be red bold" do
failed_arg.should == "\e[31m\e[1m"
it "failed_arg should be red bold" do
failed_arg.should == "\e[31m\e[1m"
end
end

describe "class methods" do
subject { AnsiEscapes }

it "failed should be red" do
subject.failed.should == "\e[31m"
end

it "failed_arg should be red bold" do
subject.failed_arg.should == "\e[31m\e[1m"
end
end
end
end
end