Skip to content

Instantly share code, notes, and snippets.

@kronos
Created February 14, 2010 19:42
Show Gist options
  • Save kronos/304212 to your computer and use it in GitHub Desktop.
Save kronos/304212 to your computer and use it in GitHub Desktop.
diff --git a/spec/ruby/core/array/shift_spec.rb b/spec/ruby/core/array/shift_spec.rb
index 1c9b773..9311cf8 100644
--- a/spec/ruby/core/array/shift_spec.rb
+++ b/spec/ruby/core/array/shift_spec.rb
@@ -143,4 +143,12 @@ describe "Array#shift" do
end
end
end
+
+ it "and shift(n) should work correct together" do
+ a = [1, 2, 3, 4, 5]
+
+ a.shift.should == 1
+ a.shift(3).should == [2, 3, 4]
+ a.should == [5]
+ end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment