update gems; robustify usage of raise_error rspec matcher

This commit is contained in:
Josh Holtrop 2016-04-19 08:33:30 -04:00
parent 80b2f7b63c
commit 6cf70753f4
2 changed files with 28 additions and 25 deletions

View File

@ -8,30 +8,30 @@ GEM
specs:
diff-lcs (1.2.5)
docile (1.1.5)
json (1.8.1)
multi_json (1.10.1)
rake (10.3.2)
rdoc (4.1.1)
json (1.8.3)
rake (10.4.2)
rdoc (4.2.2)
json (~> 1.4)
redcarpet (3.1.2)
rspec (3.0.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-core (3.0.2)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.2)
redcarpet (3.3.4)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.2)
rspec-support (~> 3.0.0)
rspec-support (3.0.2)
simplecov (0.8.2)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
yard (0.8.7.4)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
yard (0.8.7.6)
PLATFORMS
ruby
@ -44,3 +44,6 @@ DEPENDENCIES
simplecov
yard
yawpa!
BUNDLED WITH
1.10.6

View File

@ -11,7 +11,7 @@ describe Yawpa do
it "raises an exception when an invalid option is passed" do
options = { }
params = ['one', '--option', 'two']
expect { Yawpa.parse(params, options) }.to raise_error
expect { Yawpa.parse(params, options) }.to raise_error(Yawpa::ArgumentParsingException, /Unknown option/)
end
it "returns boolean options which are set" do
@ -53,7 +53,7 @@ describe Yawpa do
opt: {nargs: 2},
}
params = ['--opt', 'val']
expect { Yawpa.parse(params, options) }.to raise_error
expect { Yawpa.parse(params, options) }.to raise_error(Yawpa::ArgumentParsingException, /Not enough arguments supplied/)
end
it "uses --opt=val syntax for an option's value" do
@ -179,7 +179,7 @@ describe Yawpa do
a: {short: 'a'},
}
params = ['-ab']
expect { Yawpa.parse(params, options) }.to raise_error
expect { Yawpa.parse(params, options) }.to raise_error(Yawpa::ArgumentParsingException, /Unknown option/)
end
it "raises an error when not enough arguments are given to short option" do
@ -187,7 +187,7 @@ describe Yawpa do
a: {nargs: 1, short: 'a'},
}
params = ['-a']
expect { Yawpa.parse(params, options) }.to raise_error
expect { Yawpa.parse(params, options) }.to raise_error(Yawpa::ArgumentParsingException, /Not enough arguments supplied/)
end
it "overwrites option value when short option used after long" do