Sha256: d95667003a910454d0a9bb7ad6d16866fd612567f4f5392ed8a5cad0fe6f3ae7

Contents?: true

Size: 837 Bytes

Versions: 3

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'
require 'cucumber/formatter/ansicolor'

module Cucumber
  module Formatter
    describe ANSIColor do
      include ANSIColor

      it 'wraps passed_param with bold green and reset to green' do
        expect(passed_param('foo')).to eq "\e[32m\e[1mfoo\e[0m\e[0m\e[32m"
      end

      it 'wraps passed in green' do
        expect(passed('foo')).to eq "\e[32mfoo\e[0m"
      end

      it 'does not reset passed if there are no arguments' do
        expect(passed).to eq "\e[32m"
      end

      it 'wraps comments in grey' do
        expect(comment('foo')).to eq "\e[90mfoo\e[0m"
      end

      it 'does not generate ansi codes when colors are disabled' do
        ::Cucumber::Term::ANSIColor.coloring = false

        expect(passed('foo')).to eq 'foo'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-3.0.1 spec/cucumber/formatter/ansicolor_spec.rb
cucumber-3.0.0 spec/cucumber/formatter/ansicolor_spec.rb
cucumber-3.0.0.pre.2 spec/cucumber/formatter/ansicolor_spec.rb