[macruby-changes] [1339] MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb
source_changes at macosforge.org
source_changes at macosforge.org
Sat Apr 4 08:23:51 PDT 2009
Revision: 1339
http://trac.macosforge.org/projects/ruby/changeset/1339
Author: eloy.de.enige at gmail.com
Date: 2009-04-04 08:23:51 -0700 (Sat, 04 Apr 2009)
Log Message:
-----------
fixing Array#to_s in Ruby 1.9
Modified Paths:
--------------
MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb
Modified: MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb 2009-04-04 15:23:42 UTC (rev 1338)
+++ MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb 2009-04-04 15:23:51 UTC (rev 1339)
@@ -2,15 +2,24 @@
require File.dirname(__FILE__) + '/fixtures/classes'
describe "Array#to_s" do
- it "is equivalent to #join without a separator string" do
- old = $,
- begin
+ ruby_version_is "" .. "1.9" do
+ it "is equivalent to #join without a separator string" do
+ old = $,
+ begin
+ a = [1, 2, 3, 4]
+ a.to_s.should == a.join
+ $, = '-'
+ a.to_s.should == a.join
+ ensure
+ $, = old
+ end
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "is the array, with commas and brackets" do
a = [1, 2, 3, 4]
- a.to_s.should == a.join
- $, = '-'
- a.to_s.should == a.join
- ensure
- $, = old
+ a.to_s.should == "[1, 2, 3, 4]"
end
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090404/2ba958e0/attachment-0001.html>
More information about the macruby-changes
mailing list