mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@875a09e
This commit is contained in:
parent
a06301b103
commit
5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions
|
@ -20,7 +20,7 @@ describe "Invoking a method" do
|
|||
end
|
||||
|
||||
it "raises ArgumentError if the method has a positive arity" do
|
||||
lambda {
|
||||
-> {
|
||||
specs.fooM1
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
@ -36,7 +36,7 @@ describe "Invoking a method" do
|
|||
end
|
||||
|
||||
it "raises ArgumentError if the methods arity doesn't match" do
|
||||
lambda {
|
||||
-> {
|
||||
specs.fooM1(1,2)
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
@ -52,7 +52,7 @@ describe "Invoking a method" do
|
|||
end
|
||||
|
||||
it "raises ArgumentError if extra arguments are passed" do
|
||||
lambda {
|
||||
-> {
|
||||
specs.fooM0O1(2,3)
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
@ -64,13 +64,13 @@ describe "Invoking a method" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError if there are no values for the mandatory args" do
|
||||
lambda {
|
||||
-> {
|
||||
specs.fooM1O1
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "raises an ArgumentError if too many values are passed" do
|
||||
lambda {
|
||||
-> {
|
||||
specs.fooM1O1(1,2,3)
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
@ -107,7 +107,7 @@ describe "Invoking a method" do
|
|||
end
|
||||
|
||||
it "raises a SyntaxError with both a literal block and an object as block" do
|
||||
lambda {
|
||||
-> {
|
||||
eval "specs.oneb(10, &l){ 42 }"
|
||||
}.should raise_error(SyntaxError)
|
||||
end
|
||||
|
@ -195,20 +195,20 @@ describe "Invoking a method" do
|
|||
end
|
||||
|
||||
it "raises NameError if invoked as a vcall" do
|
||||
lambda { no_such_method }.should raise_error NameError
|
||||
-> { no_such_method }.should raise_error NameError
|
||||
end
|
||||
|
||||
it "should omit the method_missing call from the backtrace for NameError" do
|
||||
lambda { no_such_method }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
|
||||
-> { no_such_method }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
|
||||
end
|
||||
|
||||
it "raises NoMethodError if invoked as an unambiguous method call" do
|
||||
lambda { no_such_method() }.should raise_error NoMethodError
|
||||
lambda { no_such_method(1,2,3) }.should raise_error NoMethodError
|
||||
-> { no_such_method() }.should raise_error NoMethodError
|
||||
-> { no_such_method(1,2,3) }.should raise_error NoMethodError
|
||||
end
|
||||
|
||||
it "should omit the method_missing call from the backtrace for NoMethodError" do
|
||||
lambda { no_such_method() }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
|
||||
-> { no_such_method() }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -260,8 +260,8 @@ end
|
|||
describe "Invoking a private getter method" do
|
||||
it "does not permit self as a receiver" do
|
||||
receiver = LangSendSpecs::PrivateGetter.new
|
||||
lambda { receiver.call_self_foo }.should raise_error(NoMethodError)
|
||||
lambda { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError)
|
||||
-> { receiver.call_self_foo }.should raise_error(NoMethodError)
|
||||
-> { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue