Sha256: 331be7d38e07c02c7108bea5e4f7119ecbb572c9253c343dd2000201233955aa

Contents?: true

Size: 559 Bytes

Versions: 5

Compression:

Stored size: 559 Bytes

Contents

$:.unshift "../lib"
require "juggernaut"
require "test/unit"
require "shoulda"
require "mocha"

class TestMessage < Test::Unit::TestCase
  
  context "Message" do
    
    setup do
      @msg = Juggernaut::Message.new(1, "A pre-determined message body", "a81fef13919")
      assert_not_nil @msg
    end
    
    should "generate valid JSON" do
      obj = {"signature" => "a81fef13919", "body" => "A pre-determined message body", "id" => "1"}
      assert_nothing_raised do
        assert_equal obj, JSON.parse(@msg.to_s)
      end
    end
    
  end
  
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
juggernaut_rails-0.6.2 test/test_message.rb
juggernaut_rails-0.6.1 test/test_message.rb
juggernaut_rails-0.6.0 test/test_message.rb
juggernaut_rails-0.5.9 test/test_message.rb
juggernaut-0.5.8 test/test_message.rb