Sha256: 0c8001358d77a08e50ec97502e9148d0bf64da2782a38aa4be0afcad10ba6562
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
require 'spec_helper' describe StyleSet do before do @one = Style.new(:one, {}) @two = Style.new(:two, {}) @original = Style.new(:original, {}) end describe "#[]" do it "should allow lookup by style name" do style_set = StyleSet[@one, @two] style_set[:one].should equal(@one) style_set[:two].should equal(@two) end it "should still allow lookup by index" do style_set = StyleSet[@one, @two] style_set[0].should equal(@one) style_set[1].should equal(@two) end it "should return a special, empty style for :original" do style_set = StyleSet[] style_set[:original].should == @original end end describe "#clear" do before do @style_set = StyleSet[@one, @two] @style_set.clear end it "should remove all non-original styles" do @style_set[:one].should be_nil @style_set[:two].should be_nil end it "should leave the original style" do @style_set[:original].should == @original end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bulldog-0.0.1 | spec/unit/style_set_spec.rb |