Sha256: dc3ffc02e4eef240384237f519228812c4078db7117c71f0598f96ac7aeaefef

Contents?: true

Size: 859 Bytes

Versions: 13

Compression:

Stored size: 859 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'cucumber/wire_support/wire_language'

module Cucumber
  module WireSupport
    describe WirePacket do
      it "should convert to JSON" do
        packet = WirePacket.new('test_message', :foo => :bar)
        packet.to_json.should == "[\"test_message\",{\"foo\":\"bar\"}]"
      end
      
      describe ".parse" do
        it "should understand a raw packet containing no arguments" do
          packet = WirePacket.parse("[\"test_message\",null]")
          packet.message.should == 'test_message'
          packet.params.should be_nil
        end
        
        it "should understand a raw packet containging arguments data" do
          packet = WirePacket.parse("[\"test_message\",{\"foo\":\"bar\"}]")
          packet.params['foo'].should == 'bar'
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
cucumber-0.5.2 spec/cucumber/wire_support/wire_packet_spec.rb
cucumber-0.5.1 spec/cucumber/wire_support/wire_packet_spec.rb
cucumber-0.5.0 spec/cucumber/wire_support/wire_packet_spec.rb
cucumber-0.4.5.rc2 spec/cucumber/wire_support/wire_packet_spec.rb
kbaum-cucumber-0.4.5.pre spec/cucumber/wire_support/wire_packet_spec.rb
cucumber-0.4.5.rc1 spec/cucumber/wire_support/wire_packet_spec.rb
middleman-0.10.17 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/wire_support/wire_packet_spec.rb
middleman-0.10.16 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/wire_support/wire_packet_spec.rb
middleman-0.10.15 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/wire_support/wire_packet_spec.rb
rackjour-0.1.8 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/wire_support/wire_packet_spec.rb
middleman-0.10.14 vendor/gems/gems/cucumber-0.4.4/spec/cucumber/wire_support/wire_packet_spec.rb
cucumber-0.4.4 spec/cucumber/wire_support/wire_packet_spec.rb
cucumber-0.4.3 spec/cucumber/wire_support/wire_packet_spec.rb