Sha256: fef9d77cbde2dc34716b0882caff411f1a1982a8fef2d6291e6e90a1e37e9464

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

require 'bundler/setup'
Bundler.setup

require 'coveralls'
Coveralls.wear!

require "rspec"
require "set"
require 'ship_compliant'
require "savon/mock/spec_helper"
require "pry"

RSpec.configure do |config|
  config.include Savon::SpecHelper

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = "random"

  config.before(:each) do
    ShipCompliant.configuration = nil
    ShipCompliant.ship_compliant_client = nil
    ShipCompliant.configure do |c|
      c.partner_key = 'abc-123'
      c.username = 'bob@example.com'
      c.password = 'secret'
      c.log = false
      c.wsdl = 'spec/fixtures/coreservice.wsdl'
    end
  end

end

shared_examples_for "BaseResult" do
  context "success?" do
    it "returns true when the response was successful" do
      result = described_class.new({ response_status: 'Success' })
      expect(result.success?).to be_truthy
    end
  end

  context "failure?" do
    it "returns the opposite of success?" do
      result = described_class.new({})
      allow(result).to receive(:success?) { false }
      expect(result.failure?).to be_truthy
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ship_compliant-0.2.1 spec/spec_helper.rb