Sha256: b9002797c55cb264856bb215e8ac0ce17c138c6b0d1e16065fd22b6b8fce4e16
Contents?: true
Size: 1.4 KB
Versions: 1
Compression:
Stored size: 1.4 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "Placeholder" do it "should understand its size" do p = Placeholder.new(300) p.to_s.should == "<img src=\"http://placehold.it/300x300\" alt=\"placeholder\" />" end it "should understand its height and width" do p = Placeholder.new("200x300") p.to_s.should == "<img src=\"http://placehold.it/200x300\" alt=\"placeholder\" />" end it "should know about a bg_color" do p = Placeholder.new(400, :bg_color => "FFFFFF") p.to_s.should == "<img src=\"http://placehold.it/400x400/FFFFFF\" alt=\"placeholder\" />" end it "should know about a fg_color" do p = Placeholder.new(400, :bg_color => "FFFFFF", :fg_color => "FE0000") p.to_s.should == "<img src=\"http://placehold.it/400x400/FFFFFF/FE0000\" alt=\"placeholder\" />" end it "should alert the user if they set :fg_color and not :bg_color" do p = Placeholder.new(400, :fg_color => "FE0000") p.to_s.should == "<img src=\"http://placehold.it/400x400/FE0000&text=Set+:bg_color+when+using+:fg_color\" alt=\"placeholder\" />" end it "should know about its text" do p = Placeholder.new(400, :text => "Sample Text") p.to_s.should == "<img src=\"http://placehold.it/400x400&text=Sample+Text\" alt=\"placeholder\" />" end it "should throw an error when a size isn't passed in" do lambda{ Placeholder.new }.should raise_error end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
placeholder-0.0.3 | spec/placeholder_spec.rb |