Sha256: f4698fce674d05c2533cd77229ab92877a0fdc0028b2058c39145c59929a812d

Contents?: true

Size: 918 Bytes

Versions: 17

Compression:

Stored size: 918 Bytes

Contents

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

module Cucumber
  module Formatters
    describe ANSIColor do
      include ANSIColor
      
      after do
        ::Term::ANSIColor.coloring = true
      end
      
      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

17 entries across 17 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.13.2 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.13.3 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.13 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.14.1 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.14.2 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.15 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.16.1 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.16.2 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.16.3 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.16.4 spec/cucumber/formatters/ansicolor_spec.rb
aslakhellesoy-cucumber-0.1.16 spec/cucumber/formatters/ansicolor_spec.rb
kosmas58-cucumber-0.1.16.5 spec/cucumber/formatters/ansicolor_spec.rb
kosmas58-cucumber-0.1.16.6 spec/cucumber/formatters/ansicolor_spec.rb
cucumber-0.1.13 spec/cucumber/formatters/ansicolor_spec.rb
cucumber-0.1.14 spec/cucumber/formatters/ansicolor_spec.rb
cucumber-0.1.15 spec/cucumber/formatters/ansicolor_spec.rb
cucumber-0.1.16 spec/cucumber/formatters/ansicolor_spec.rb