Sha256: 5d5b65a839134ef719d1e242951070ef268df343cd8aae247c57e34ad170fcc3

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

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

module Cucumber
  module WireSupport
    describe WireException do
      before(:each) do
        @host, @port = 'localhost', '54321'
      end
      def exception
        WireException.new(@data, @host, @port)
      end
      describe "with just a message" do
        before(:each) do
          @data = {'message' => 'foo'}
        end
        it "should #to_s as expected" do
          exception.to_s.should == "foo"
        end
      end
      
      describe "with a message and an exception" do
        before(:each) do
          @data = {'message' => 'foo', 'exception' => 'Bar'}
        end
        it "should #to_s as expected" do
          exception.to_s.should == "foo"
        end
        it "#class.to_s should return the name of the exception" do
          exception.class.to_s.should == 'Bar from localhost:54321'
        end
      end
      
      describe "with a custom backtrace" do
        before(:each) do
          @data = {'message' => 'foo', 'backtrace' => ['foo', 'bar', 'baz']}
        end
        it "#backrace should return the custom backtrace" do
          exception.backtrace.should == ['foo', 'bar', 'baz']
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
davidtrogers-cucumber-0.6.2 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.6.2 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.6.1 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.6.0 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.5.3 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.5.2 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.5.1 spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-0.5.0 spec/cucumber/wire_support/wire_exception_spec.rb