Sha256: 3a7211468c23c80af0609f33b7b20962e468ba8ec91a27e749fc4168000c8779

Contents?: true

Size: 709 Bytes

Versions: 9

Compression:

Stored size: 709 Bytes

Contents

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

describe Braintree::ValidationError do
  describe "initialize" do
    it "works" do
      error = Braintree::ValidationError.new :attribute => "some model attribute", :code => 1, :message => "bad juju"
      expect(error.attribute).to eq("some model attribute")
      expect(error.code).to eq(1)
      expect(error.message).to eq("bad juju")
    end
  end

  describe "inspect" do
    it "is pretty" do
      error = Braintree::ValidationError.new :attribute => "number", :code => "123456", :message => "Number is bad juju."
      expect(error.inspect).to eq("#<Braintree::ValidationError (123456) Number is bad juju.>")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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