Sha256: b203c58fb61ee55ca40982003bdd8c853dab0260277e6e18f21253e94fc2f893

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

require 'spec_helper'
require 'routemaster/cli/top_level'
require 'webmock/rspec'

describe Routemaster::CLI::Pub, type: :cli do
  before { allow_bus_pulse 'bus.dev', 's3cr3t' }

  context 'with too few arguments' do
    let(:argv) { [] }
    it { expect { perform }.to raise_error(Routemaster::CLI::Exit) }
    it { expect { perform rescue nil }.to change { stderr.string }.to a_string_matching(/Usage/) }
  end

  context 'with correct arguments' do
    let(:argv) { %w[pub created widgets https://example.com/widgets/1 -b bus.dev -t s3cr3t] }
    it { 
      expect(client).to receive(:created).with('widgets', 'https://example.com/widgets/1')
      perform
    }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
routemaster-client-3.2.3 spec/cli/pub_spec.rb
routemaster-client-3.2.0 spec/cli/pub_spec.rb
routemaster-client-3.1.2 spec/cli/pub_spec.rb
routemaster-client-3.1.1 spec/cli/pub_spec.rb