shared_examples_for "a zelda base model" do it "should respond to the attributes set in the constructor" do described_class.new(:foo => 'bar').foo.should eq('bar') end it "should return nil for an attribute set to nil" do described_class.new(:foo => nil).foo.should be_nil end it "should not respond to attributes not set in the constructor" do lambda { subject.no_not_here_nope }.should raise_error(NoMethodError) end end