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
|
@ -15,26 +15,26 @@ describe "Enumerable#none?" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when more than 1 argument is provided" do
|
||||
lambda { @enum.none?(1, 2, 3) }.should raise_error(ArgumentError)
|
||||
lambda { [].none?(1, 2, 3) }.should raise_error(ArgumentError)
|
||||
lambda { {}.none?(1, 2, 3) }.should raise_error(ArgumentError)
|
||||
-> { @enum.none?(1, 2, 3) }.should raise_error(ArgumentError)
|
||||
-> { [].none?(1, 2, 3) }.should raise_error(ArgumentError)
|
||||
-> { {}.none?(1, 2, 3) }.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
ruby_version_is ""..."2.5" do
|
||||
it "raises an ArgumentError when any arguments provided" do
|
||||
lambda { @enum.none?(Proc.new {}) }.should raise_error(ArgumentError)
|
||||
lambda { @enum.none?(nil) }.should raise_error(ArgumentError)
|
||||
lambda { @empty.none?(1) }.should raise_error(ArgumentError)
|
||||
lambda { @enum.none?(1) {} }.should raise_error(ArgumentError)
|
||||
-> { @enum.none?(Proc.new {}) }.should raise_error(ArgumentError)
|
||||
-> { @enum.none?(nil) }.should raise_error(ArgumentError)
|
||||
-> { @empty.none?(1) }.should raise_error(ArgumentError)
|
||||
-> { @enum.none?(1) {} }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
it "does not hide exceptions out of #each" do
|
||||
lambda {
|
||||
-> {
|
||||
EnumerableSpecs::ThrowingEach.new.none?
|
||||
}.should raise_error(RuntimeError)
|
||||
|
||||
lambda {
|
||||
-> {
|
||||
EnumerableSpecs::ThrowingEach.new.none? { false }
|
||||
}.should raise_error(RuntimeError)
|
||||
end
|
||||
|
@ -82,7 +82,7 @@ describe "Enumerable#none?" do
|
|||
end
|
||||
|
||||
it "does not hide exceptions out of the block" do
|
||||
lambda {
|
||||
-> {
|
||||
@enum.none? { raise "from block" }
|
||||
}.should raise_error(RuntimeError)
|
||||
end
|
||||
|
@ -126,7 +126,7 @@ describe "Enumerable#none?" do
|
|||
end
|
||||
|
||||
it "does not hide exceptions out of #each" do
|
||||
lambda {
|
||||
-> {
|
||||
EnumerableSpecs::ThrowingEach.new.none?(Integer)
|
||||
}.should raise_error(RuntimeError)
|
||||
end
|
||||
|
@ -151,7 +151,7 @@ describe "Enumerable#none?" do
|
|||
|
||||
it "does not hide exceptions out of pattern#===" do
|
||||
pattern = EnumerableSpecs::Pattern.new { raise "from pattern" }
|
||||
lambda {
|
||||
-> {
|
||||
@enum.none?(pattern)
|
||||
}.should raise_error(RuntimeError)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue