Skip to content
This repository
Browse code

Array#flatten! Guard frozen behav. [core:23663]

  • Loading branch information...
commit 1614ccc12e738f153382a47f468d605e9073128a 1 parent 04f78e9
runpaint authored June 02, 2009

Showing 1 changed file with 11 additions and 8 deletions. Show diff stats Hide diff stats

  1. 19  core/array/flatten_spec.rb
19  core/array/flatten_spec.rb
@@ -190,17 +190,20 @@
190 190
       nested_ary.freeze
191 191
       lambda { nested_ary.flatten! }.should raise_error(TypeError)
192 192
     end
  193
+  
  194
+    it "does not raise on frozen arrays when no modification would take place" do
  195
+      ArraySpecs.frozen_array.flatten!.should be_nil
  196
+    end
193 197
   end
194 198
 
195 199
   ruby_version_is '1.9' do
196  
-    it "raises a RuntimeError on frozen arrays when modification would take place" do
197  
-      nested_ary = [1, 2, []]
198  
-      nested_ary.freeze
199  
-      lambda { nested_ary.flatten! }.should raise_error(RuntimeError)
  200
+    ruby_bug "[ruby-core:23663]", "1.9.2" do
  201
+      it "raises a RuntimeError on frozen arrays" do
  202
+        nested_ary = [1, 2, []]
  203
+        nested_ary.freeze
  204
+        lambda { nested_ary.flatten! }.should raise_error(RuntimeError)
  205
+        lambda { ArraySpecs.frozen_array.flatten! }.should raise_error(RuntimeError)
  206
+      end
200 207
     end
201 208
   end
202  
-
203  
-  it "does not raise on frozen arrays when no modification would take place" do
204  
-    ArraySpecs.frozen_array.flatten!.should be_nil
205  
-  end
206 209
 end

0 notes on commit 1614ccc

Please sign in to comment.
Something went wrong with that request. Please try again.