summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/keep_if_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/keep_if_spec.rb')
-rw-r--r--spec/ruby/core/array/keep_if_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/array/keep_if_spec.rb b/spec/ruby/core/array/keep_if_spec.rb
new file mode 100644
index 0000000000..40f7329b7c
--- /dev/null
+++ b/spec/ruby/core/array/keep_if_spec.rb
@@ -0,0 +1,11 @@
+require_relative '../../spec_helper'
+require_relative 'shared/keep_if'
+
+describe "Array#keep_if" do
+ it "returns the same array if no changes were made" do
+ array = [1, 2, 3]
+ array.keep_if { true }.should equal(array)
+ end
+
+ it_behaves_like :keep_if, :keep_if
+end