Sha256: e7dcd7731ee9d289c85e1965c753717bbe0f615cd8d106526969305fd86410cb

Contents?: true

Size: 842 Bytes

Versions: 46

Compression:

Stored size: 842 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'cucumber/formatter/ansicolor'

module Cucumber
  module Formatter
    describe ANSIColor do
      include ANSIColor
      
      it "should wrap passed_param with bold green and reset to green" do
        passed_param("foo").should == "\e[32m\e[1mfoo\e[0m\e[0m\e[32m"
      end

      it "should wrap passed in green" do
        passed("foo").should == "\e[32mfoo\e[0m"
      end

      it "should not reset passed if there are no arguments" do
        passed.should == "\e[32m"
      end

      it "should wrap comments in grey" do
        comment("foo").should == "\e[90mfoo\e[0m"
      end
      
      it "should not generate ansi codes when colors are disabled" do
        ::Term::ANSIColor.coloring = false
        passed("foo").should == "foo"
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 9 rubygems

Version Path
aslakhellesoy-cucumber-0.3.100 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.101.2 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.101 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.102.1 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.102.2 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.102 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.103 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.104 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.98 spec/cucumber/formatter/ansicolor_spec.rb
aslakhellesoy-cucumber-0.3.99 spec/cucumber/formatter/ansicolor_spec.rb
dwaite-cucumber-0.3.101 spec/cucumber/formatter/ansicolor_spec.rb
engineyard-cucumber-0.3.101 spec/cucumber/formatter/ansicolor_spec.rb
kosmas58-cucumber-0.3.100 spec/cucumber/formatter/ansicolor_spec.rb
kosmas58-cucumber-0.3.102 spec/cucumber/formatter/ansicolor_spec.rb
kosmas58-cucumber-0.3.103 spec/cucumber/formatter/ansicolor_spec.rb
kosmas58-cucumber-0.3.98 spec/cucumber/formatter/ansicolor_spec.rb
kosmas58-cucumber-0.3.99 spec/cucumber/formatter/ansicolor_spec.rb
davidtrogers-cucumber-0.6.2 spec/cucumber/formatter/ansicolor_spec.rb
cucumber-0.6.2 spec/cucumber/formatter/ansicolor_spec.rb
cucumber-0.6.1 spec/cucumber/formatter/ansicolor_spec.rb