Sha256: 68cebdb193201c4c8d230629a3a949298be1a556b5b0fee819eea535613c408e

Contents?: true

Size: 825 Bytes

Versions: 4

Compression:

Stored size: 825 Bytes

Contents

require_relative '../spec_helper'

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

      it 'should wrap passed in green' do
        passed('test').should == "\e[32mtest\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('test').should == "\e[90mtest\e[0m"
      end

      it 'should not generate ansi codes when colors are disabled' do
        ::Lucid::Term::ANSIColor.coloring = false
        passed('test').should == 'test'
      end
      
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lucid-0.4.1 spec/lucid/ansicolor_spec.rb
lucid-0.4.0 spec/lucid/ansicolor_spec.rb
lucid-0.3.3 spec/lucid/ansicolor_spec.rb
lucid-0.3.0 spec/lucid/ansicolor_spec.rb