Sha256: 99645a61593f4e0fece824668795e9f3e78ff2060f2327042f0692854323e51d
Contents?: true
Size: 1.4 KB
Versions: 17
Compression:
Stored size: 1.4 KB
Contents
require 'spec_helper' describe Style do describe "#initialize" do it "should create a Style with the given name and attributes" do style = Style.new(:big, :size => '100x100') style.name.should == :big style.attributes.should == {:size => '100x100'} end end describe "#[]" do it "should return the value of the named attribute" do style = Style.new(:big, :size => '100x100') style[:size].should == '100x100' end end describe "#==" do it "should return true if the names and attributes are both equal" do a = Style.new(:big, :size => '100x100') b = Style.new(:big, :size => '100x100') a.should == b end it "should return false if the names are not equal" do a = Style.new(:big, :size => '100x100') b = Style.new(:bad, :size => '100x100') a.should_not == b end it "should return true if the attributes are not equal" do a = Style.new(:big, :size => '100x100') b = Style.new(:big, :size => '1x1') a.should_not == b end it "should not blow up if the argument is not a Style" do a = Style.new(:big, :size => '100x100') b = Object.new a.should_not == b end end describe "#inspect" do it "should show the name and attributes" do style = Style.new(:big, :size => '100x100') style.inspect.should == "#<Style :big {:size=>\"100x100\"}>" end end end
Version data entries
17 entries across 17 versions & 1 rubygems