spec/unit/documents/document_spec.rb in hushed-0.0.2 vs spec/unit/documents/document_spec.rb in hushed-0.0.3

- old
+ new

@@ -9,14 +9,26 @@ assert date = @object.date.strftime("%Y%m%d_%H%M%S") expected_filename = "#{bn}_#{type}_#{number}_#{date}.xml" assert_equal expected_filename, @object.filename end - def test_it_should_respond_to_warehouse - assert @object.respond_to?(:warehouse), "#{@object.class} does not respond to #warehouse" + def test_it_should_not_raise_an_exception_when_getting_the_warehouse + assert @object.warehouse end + def test_it_should_not_raise_an_exception_when_getting_the_message_id + assert @object.message_id + end + + def test_it_should_not_raise_an_exception_when_getting_the_type + assert @object.type + end + + def test_it_should_not_raise_an_exception_when_getting_the_date + assert @object.date + end + def test_it_should_be_initializable_with_a_hash begin @object.class.new(:thinger => 123) rescue TypeError flunk "It should be possible to initialize #{@object.class} with an args hash" @@ -32,13 +44,14 @@ before do @object = DocumentDouble.new( :message_id => '1234567', :date => Time.new(2013, 04, 05, 12, 30, 15).utc, - :client => @client, + :client => ClientDouble.new(:warehouse => 'fancywarehouse'), :type => 'Thinger', :business_unit => 'HUSHED', - :document_number => '123456' + :document_number => '123456', + :warehouse => 'fancywarehouse' ) end end end