2018-03-04 10:09:32 -05:00
|
|
|
require_relative '../../spec_helper'
|
2017-05-07 08:04:49 -04:00
|
|
|
require 'getoptlong'
|
|
|
|
|
|
|
|
describe "GetoptLong#terminated?" do
|
|
|
|
it "returns true if option processing has terminated" do
|
|
|
|
argv [ "--size", "10k" ] do
|
|
|
|
opts = GetoptLong.new(["--size", GetoptLong::REQUIRED_ARGUMENT])
|
2020-05-03 06:28:29 -04:00
|
|
|
opts.should_not.terminated?
|
2017-05-07 08:04:49 -04:00
|
|
|
|
|
|
|
opts.get.should == ["--size", "10k"]
|
2020-05-03 06:28:29 -04:00
|
|
|
opts.should_not.terminated?
|
2017-05-07 08:04:49 -04:00
|
|
|
|
|
|
|
opts.get.should == nil
|
2020-05-03 06:28:29 -04:00
|
|
|
opts.should.terminated?
|
2017-05-07 08:04:49 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|