summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/select_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/select_spec.rb')
-rw-r--r--spec/ruby/core/array/select_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/array/select_spec.rb b/spec/ruby/core/array/select_spec.rb
new file mode 100644
index 0000000000..298b591744
--- /dev/null
+++ b/spec/ruby/core/array/select_spec.rb
@@ -0,0 +1,14 @@
+require_relative '../../spec_helper'
+require_relative 'shared/select'
+
+describe "Array#select" do
+ it_behaves_like :array_select, :select
+end
+
+describe "Array#select!" do
+ it "returns nil if no changes were made in the array" do
+ [1, 2, 3].select! { true }.should be_nil
+ end
+
+ it_behaves_like :keep_if, :select!
+end