Sha256: 36da0f1c9f6e553af21b5cd8e0b702399e1ccf8b8216e987a6283fe63635dc36

Contents?: true

Size: 524 Bytes

Versions: 7

Compression:

Stored size: 524 Bytes

Contents

require "spec_helper"

describe '#parse_opts' do
  it 'should assign to :string option' do
    options = Reckon::Options.parse_command_line_options(
      %w[-f - --unattended --account bank],
      StringIO.new('foo,bar,baz')
    )
    expect(options[:string]).to eq('foo,bar,baz')
  end

  it 'should require --unattended flag' do
    expect { Reckon::Options.parse_command_line_options(%w[-f - --account bank]) }.to(
      raise_error(RuntimeError, "--unattended is required to use STDIN as CSV source.")
    )
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reckon-0.10.0 spec/reckon/options_spec.rb
reckon-0.9.6 spec/reckon/options_spec.rb
reckon-0.9.5 spec/reckon/options_spec.rb
reckon-0.9.4 spec/reckon/options_spec.rb
reckon-0.9.3 spec/reckon/options_spec.rb
reckon-0.9.2 spec/reckon/options_spec.rb
reckon-0.9.1 spec/reckon/options_spec.rb