Sha256: 1cf8755a2895f7523b88a03d037960134955a85ce3f38f943e63f15a121074ff

Contents?: true

Size: 935 Bytes

Versions: 10

Compression:

Stored size: 935 Bytes

Contents

require "spec_helper"
require "mvcli/argv"
require "shellwords"

describe "ARGV" do
  use_natural_assertions
  Given(:input) {Shellwords.shellsplit "before --one 1 --two=two stuff in the middle --three -f --four --no-five -p 6 --mo money --mo problems --two-word val --two-word-p after"}
  Given(:argv) {MVCLI::Argv.new input, [:three, :f, :five, :two_word_p]}

  context " options" do
    Given(:options) {argv.options}
    Then {options[:one] == ['1']}
    Then {options[:two] == ['two']}
    Then {options[:three] == [true]}
    Then {options[:f] == [true]}
    Then {options[:four] == []}
    Then {options[:five] == [false]}
    Then {options[:p] == ['6']}
    Then {options[:mo] == ['money', 'problems']}
    Then {options[:two_word] == ['val']}
    Then {options[:two_word_p] == [true]}
  end
  context " aruments" do
    Given(:arguments) {argv.arguments}
    Then {arguments == %w(before stuff in the middle after)}
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mvcli-0.1.0 spec/mvcli/argv_spec.rb
mvcli-0.0.16 spec/mvcli/argv_spec.rb
mvcli-0.0.14 spec/mvcli/argv_spec.rb
mvcli-0.0.13 spec/mvcli/argv_spec.rb
mvcli-0.0.12 spec/mvcli/argv_spec.rb
mvcli-0.0.11 spec/mvcli/argv_spec.rb
mvcli-0.0.10 spec/mvcli/argv_spec.rb
mvcli-0.0.9 spec/mvcli/argv_spec.rb
mvcli-0.0.8 spec/mvcli/argv_spec.rb
mvcli-0.0.7 spec/mvcli/argv_spec.rb