Sha256: e9e7172bc9256a1ada1665ccd09e1d26639ac02ca608d59e709b215cf5899dbe
Contents?: true
Size: 773 Bytes
Versions: 26
Compression:
Stored size: 773 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')) describe Factory::Attribute::Static do before do @name = :first_name @value = 'John' @attr = Factory::Attribute::Static.new(@name, @value) end it "should have a name" do @attr.name.should == @name end it "should set its static value on a proxy" do @proxy = "proxy" mock(@proxy).set(@name, @value) @attr.add_to(@proxy) end it "should raise an error when defining an attribute writer" do lambda { Factory::Attribute::Static.new('test=', nil) }.should raise_error(Factory::AttributeDefinitionError) end it "should convert names to symbols" do Factory::Attribute::Static.new('name', nil).name.should == :name end end
Version data entries
26 entries across 26 versions & 14 rubygems