Sha256: bfa25c8b38467f1d8ae3ea651a27b7983b6716c6de0f50fc197a45b435b6ecb4

Contents?: true

Size: 611 Bytes

Versions: 11

Compression:

Stored size: 611 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe Braintree::BaseModule do
  describe "return_object_or_raise" do
    it "inspects the error_result when inspecting the exception" do
      result = Braintree::ErrorResult.new(:errors => {})
      begin
        klass = Class.new { include Braintree::BaseModule }
        klass.return_object_or_raise(:obj) { result }
      rescue Braintree::ValidationsFailed => ex
      end
      ex.should_not == nil
      ex.error_result.should == result
      ex.inspect.should include(result.inspect)
      ex.to_s.should include(result.inspect)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
braintree-2.4.0 spec/unit/braintree/base_module_spec.rb
braintree-2.3.1 spec/unit/braintree/base_module_spec.rb
braintree-2.2.0 spec/unit/braintree/base_module_spec.rb
braintree-2.1.0 spec/unit/braintree/base_module_spec.rb
braintree-2.0.0 spec/unit/braintree/base_module_spec.rb
braintree-1.2.1 spec/unit/braintree/base_module_spec.rb
braintree-1.2.0 spec/unit/braintree/base_module_spec.rb
braintree-1.1.3 spec/unit/braintree/base_module_spec.rb
braintree-1.1.2 spec/unit/braintree/base_module_spec.rb
braintree-1.1.1 spec/unit/braintree/base_module_spec.rb
braintree-1.1.0 spec/unit/braintree/base_module_spec.rb