Skip to content

Commit 1e971da

Browse files
ndnenkoveregon
authored andcommitted
Add specs for #dig with no arguments
1 parent 59b2043 commit 1e971da

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

core/array/dig_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}.should raise_error(TypeError)
3434
end
3535

36-
it "raises without any args" do
36+
it "raises an ArgumentError if no arguments provided" do
3737
lambda {
3838
[10].dig()
3939
}.should raise_error(ArgumentError)

core/hash/dig_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
h.dig(:foo, :zot, :xyz).should == nil
2929
end
3030

31-
it "raises without args" do
31+
it "raises an ArgumentError if no arguments provided" do
3232
lambda { { the: 'borg' }.dig() }.should raise_error(ArgumentError)
3333
end
3434

core/struct/dig_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
}.should raise_error(TypeError)
2626
end
2727

28+
it "raises an ArgumentError if no arguments provided" do
29+
lambda { @instance.dig }.should raise_error(ArgumentError)
30+
end
31+
2832
it "calls #dig on any intermediate step with the rest of the sequence as arguments" do
2933
obj = Object.new
3034
instance = @klass.new(obj)

0 commit comments

Comments
 (0)