Sha256: 50c3998e7caef73267440fc53ec41b3383f63c66baf5930cc4554f0b1062e52c

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

require 'wlog/tech/wlog_string'
require 'wlog/tech/ansi_colors'

include Wlog
include AnsiColors

describe WlogString do
  before(:all) do
    @str = WlogString
  end

  it 'should write in red' do
    expect(@str.red('')).to match(/^\x1b\[#{Red}/)
    expect(@str.red('')).to match(/\x1b\[0m$/)
  end

  it 'should write in green' do
    expect(@str.green('')).to match(/^\x1b\[#{Green}/)
    expect(@str.green('')).to match(/\x1b\[0m$/)
  end

  it 'should write in blue' do
    expect(@str.blue('')).to match(/^\x1b\[#{Blue}/)
    expect(@str.blue('')).to match(/\x1b\[0m$/)
  end

  it 'should write in yellow' do
    expect(@str.yellow('')).to match(/^\x1b\[#{Yellow}/)
    expect(@str.yellow('')).to match(/\x1b\[0m$/)
  end

  it 'should write in white' do
    expect(@str.white('')).to match(/^\x1b\[#{White}/)
    expect(@str.white('')).to match(/\x1b\[0m$/)
  end

  it 'should write in cyan' do
    expect(@str.cyan('')).to match(/^\x1b\[#{Cyan}/)
    expect(@str.cyan('')).to match(/\x1b\[0m$/)
  end

  it 'should write in magenta' do
    expect(@str.magenta('')).to match(/^\x1b\[#{Magenta}/)
    expect(@str.magenta('')).to match(/\x1b\[0m$/)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wlog-1.2.2 spec/tech/wlog_string_spec.rb
wlog-1.2.1 spec/tech/wlog_string_spec.rb
wlog-1.2.0 spec/tech/wlog_string_spec.rb
wlog-1.1.7 spec/tech/wlog_string_spec.rb
wlog-1.1.6 spec/tech/wlog_string_spec.rb
wlog-1.1.5 spec/tech/wlog_string_spec.rb