Sha256: a23527832fe6fd85dc6a05788480b2a5baec8d753b08b8a323e959636432a16e
Contents?: true
Size: 970 Bytes
Versions: 2
Compression:
Stored size: 970 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') $pop = PlainOptionParser.new do desc "set abc" cmd "test set abc" do |value| $abc = value $abc += flags["app"] if flags["app"] end desc "unset abc" cmd "test unset abc" do $abc = false end desc "with placeholder" cmd "test with [placeholder]" do |value| $placeholder = value end end describe "PlainOptionParser" do before do $abc = nil end it "should set placeholder" do $pop.start %w[test with 123] $placeholder.should == "123" end it "should set abc" do $pop.start %w[test set abc 123] $abc.should == "123" end it "should not match partial paths" do $pop.start %w[test set] $abc.should be_nil end it "should unset abc" do $pop.start %w[test unset abc] $abc.should be_false end it "should take a flag" do $pop.start %w[test set abc 123 --app foo] $abc.should == "123foo" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
plain_option_parser-1.0.0 | spec/plain_option_parser_spec.rb |
plain_option_parser-0.2.0 | spec/plain_option_parser_spec.rb |