spec/message_spec.rb in dripdrop-0.9.3 vs spec/message_spec.rb in dripdrop-0.9.4

- old
+ new

@@ -26,11 +26,11 @@ lambda { DripDrop::Message.new('nameonly') }.should_not raise_exception end it "should set the head to a single key hash containing message class if nil provided" do - DripDrop::Message.new('nilhead', :head => nil).head.should == {'msg_class' => 'DripDrop::Message'} + DripDrop::Message.new('nilhead', :head => nil).head.should == {'message_class' => 'DripDrop::Message'} end it "should raise an exception if a non-hash, non-nil head is provided" do lambda { DripDrop::Message.new('arrhead', :head => []) }.should raise_exception(ArgumentError) @@ -65,11 +65,11 @@ end describe "subclassing" do def create_auto_message attrs = { :name => 'test', - :head => {'foo' => 'bar', 'msg_class' => 'SpecMessageClass'}, + :head => {'foo' => 'bar', 'message_class' => 'SpecMessageClass'}, :body => ['foo', 'bar', 'baz'] } message = DripDrop::AutoMessageClass.create_message(attrs) @@ -85,13 +85,13 @@ msg = DripDrop::Message.new('test') lambda{SpecMessageClass.recreate_message(msg.to_hash)}.should raise_exception end describe "DripDrop::AutoMessageClass" do - it "should create a properly classed message based on head['msg_class']" do + it "should create a properly classed message based on head['message_class']" do @message.should be_a(SpecMessageClass) end - it "should recreate a message based on head['msg_class']" do + it "should recreate a message based on head['message_class']" do DripDrop::AutoMessageClass.recreate_message(@message.to_hash).should be_a(SpecMessageClass) end end end end