Sha256: 1041371ebeeb806be7bedd636abb83b5a4cbbf53d4a51fa8d71de605794b8ed0

Contents?: true

Size: 1.22 KB

Versions: 39

Compression:

Stored size: 1.22 KB

Contents

require '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

39 entries across 37 versions & 9 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
casecumber-1.0.2.1 spec/cucumber/wire_support/wire_exception_spec.rb
casecumber-1.2.1.cb2 spec/cucumber/wire_support/wire_exception_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-1.2.1 spec/cucumber/wire_support/wire_exception_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/spec/cucumber/wire_support/wire_exception_spec.rb
cucumber-1.2.0 spec/cucumber/wire_support/wire_exception_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/wire_support/wire_exception_spec.rb