Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@Empact

This is a step toward fixing cucumber/cucumber#219 by exposing the AnsiEscapes methods at the module-level as well.

@Empact Empact referenced this pull request in cucumber/cucumber-ruby
Merged

Don't pollute RbWorld with the AnsiEscapes methods #221

@aslakhellesoy aslakhellesoy merged commit 3fc4b6c into cucumber:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 7, 2012
  1. @Empact
This page is out of date. Refresh to see the latest.
View
2  lib/gherkin/formatter/ansi_escapes.rb
@@ -90,6 +90,8 @@ def reset
def up(n)
"\e[#{n}A"
end
+
+ extend self
end
end
end
View
25 spec/gherkin/formatter/ansi_escapes_spec.rb
@@ -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
Something went wrong with that request. Please try again.