Sha256: 20e0f04969e8ec0c9d657b61b1a8e5113fa64dc96d12b4ee5de542325bee9020

Contents?: true

Size: 833 Bytes

Versions: 91

Compression:

Stored size: 833 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

91 entries across 91 versions & 1 rubygems

Version Path
epitools-0.5.103 spec/colored_spec.rb
epitools-0.5.100 spec/colored_spec.rb
epitools-0.5.99 spec/colored_spec.rb
epitools-0.5.98 spec/colored_spec.rb
epitools-0.5.97 spec/colored_spec.rb
epitools-0.5.96 spec/colored_spec.rb
epitools-0.5.95 spec/colored_spec.rb
epitools-0.5.94 spec/colored_spec.rb
epitools-0.5.93 spec/colored_spec.rb
epitools-0.5.92 spec/colored_spec.rb
epitools-0.5.91 spec/colored_spec.rb
epitools-0.5.90 spec/colored_spec.rb
epitools-0.5.89 spec/colored_spec.rb
epitools-0.5.88 spec/colored_spec.rb
epitools-0.5.87 spec/colored_spec.rb
epitools-0.5.86 spec/colored_spec.rb
epitools-0.5.85 spec/colored_spec.rb
epitools-0.5.84 spec/colored_spec.rb
epitools-0.5.83 spec/colored_spec.rb
epitools-0.5.82 spec/colored_spec.rb