Sha256: 3800ace9dd7416948d4d59215d614594cf166626d5ae9ae902ee6b1ab1f88020

Contents?: true

Size: 821 Bytes

Versions: 27

Compression:

Stored size: 821 Bytes

Contents

require 'epitools'

describe "Colored strings" do

  it "has string methods" do
    s = "string"
    s.should respond_to(:blue)
    s.should respond_to(:light_blue)
    s.should respond_to(:bright_blue)
    s.should respond_to(:grey)
    s.should respond_to(:gray)
    s.should respond_to(:purple)
    s.should respond_to(:magenta)
    lambda { s.light_blue }.should_not raise_error
  end

  it "can do bbs colors" do
    "<5>yay".colorize.should == "yay".magenta
  end

  it "can do tagged colors" do
    "<blue>hello".colorize.should == "hello".blue
    "<magenta>hello".colorize.should == "<purple>hello".colorize
    "<gray>hello".colorize.should == "<light_black>hello".colorize
    lambda { "</blue>".colorize }.should raise_error
    "<black_on_yellow>hello".colorize.should == "hello".black_on_yellow
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
epitools-0.5.136 spec/colored_spec.rb
epitools-0.5.134 spec/colored_spec.rb
epitools-0.5.133 spec/colored_spec.rb
epitools-0.5.131 spec/colored_spec.rb
epitools-0.5.130 spec/colored_spec.rb
epitools-0.5.129 spec/colored_spec.rb
epitools-0.5.128 spec/colored_spec.rb
epitools-0.5.126 spec/colored_spec.rb
epitools-0.5.125 spec/colored_spec.rb
epitools-0.5.124 spec/colored_spec.rb
epitools-0.5.123 spec/colored_spec.rb
epitools-0.5.122 spec/colored_spec.rb
epitools-0.5.121 spec/colored_spec.rb
epitools-0.5.119 spec/colored_spec.rb
epitools-0.5.118 spec/colored_spec.rb
epitools-0.5.116 spec/colored_spec.rb
epitools-0.5.115 spec/colored_spec.rb
epitools-0.5.114 spec/colored_spec.rb
epitools-0.5.113 spec/colored_spec.rb
epitools-0.5.112 spec/colored_spec.rb