Sha256: 0a4c7d578981a89fddf67b65796242fd63ee46b7cfbbda08067ac6e3e144463f

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

module Wicoris::Postman
  describe CLI do
    let(:cli) { CLI.new }

    describe '#run' do
      it 'runs a new postman with options' do
        postman = double('postman')
        opts = double('config')
        cli.should_receive(:opts).and_return(opts)
        Postman.should_receive(:new).ordered.with(opts).and_return(postman)
        postman.should_receive(:run)
        cli.run
      end
    end

    describe '#opts' do
      it 'returns the application-wide options' do
        cli.should_receive(:parse_options).ordered
        expect(cli.send(:opts)).to eq(Config)
      end

      it 'reads a given config file'

      it 'merges command-line opts with the global config'
    end

    describe '#logger' do
      let(:logger) { double('logger') }

      it 'returns a new ruby-cabin logger' do
        pending 'logging has changed'
        Cabin::Channel.should_receive(:new).and_return(logger)
        logger.should_receive(:subscribe).with(STDOUT)
        expect(cli.send(:logger)).to eq logger
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wicoris-postman-0.13.0 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.12.2 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.12.1 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.12.0 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.11.3 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.11.2 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.11.1 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.11.0 spec/wicoris/postman/cli_spec.rb
wicoris-postman-0.10.0 spec/wicoris/postman/cli_spec.rb