Sha256: 8e5983ebaa8b19446df64783068a7de5b8ca759e657f4c81f315067120be6491

Contents?: true

Size: 657 Bytes

Versions: 7

Compression:

Stored size: 657 Bytes

Contents

require File.expand_path(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(:gateway, :errors => {})
      begin
        klass = Class.new { include Braintree::BaseModule }
        klass.return_object_or_raise(:obj) { result }
      rescue Braintree::ValidationsFailed => ex
      expect(ex).not_to eq(nil)
      expect(ex.error_result).to eq(result)
      expect(ex.inspect).to include(result.inspect)
      expect(ex.to_s).to include(result.inspect)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
braintree-4.23.0 spec/unit/braintree/base_module_spec.rb
braintree-4.22.0 spec/unit/braintree/base_module_spec.rb
braintree-4.21.0 spec/unit/braintree/base_module_spec.rb
braintree-4.20.0 spec/unit/braintree/base_module_spec.rb
braintree-4.19.0 spec/unit/braintree/base_module_spec.rb
braintree-4.18.0 spec/unit/braintree/base_module_spec.rb
braintree-4.17.0 spec/unit/braintree/base_module_spec.rb