Sha256: 75b550c0442405f0072cfed71c34dd02bcdb09a4a76ca6e59d595b4134ae6c3a

Contents?: true

Size: 482 Bytes

Versions: 6

Compression:

Stored size: 482 Bytes

Contents

require "spec_helper"

describe '#parse_opts' do
  it 'should assign to :string option' do
    options = Reckon::Options.parse(
      %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(%w[-f - --account bank]) }.to(
      raise_error(RuntimeError, "--unattended is required to use STDIN as CSV source.")
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reckon-0.9.0 spec/reckon/options_spec.rb
reckon-0.8.1 spec/reckon/options_spec.rb
reckon-0.8.0 spec/reckon/options_spec.rb
reckon-0.7.2 spec/reckon/options_spec.rb
reckon-0.7.1 spec/reckon/options_spec.rb
reckon-0.7.0 spec/reckon/options_spec.rb