From 9b655ad63ace82bfd16a93ff492d1c6e96643be8 Mon Sep 17 00:00:00 2001 From: Mike Dvorkin Date: Wed, 5 Sep 2012 22:25:52 -0700 Subject: [PATCH] Small spec tweak for Ruby 1.8.x --- spec/misc_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 4e81933..be15160 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -127,7 +127,7 @@ EOS @awesome_method = "".method(:red) String.instance_eval do - define_method :red do # Method arity is 0. + define_method :red do # Method arity is now 0 in Ruby 1.9+. "[red]#{self}[/red]" end end @@ -142,7 +142,11 @@ EOS it "shoud not raise ArgumentError when formatting HTML" do out = "hello".ai(:color => { :string => :red }, :html => true) - out.should == %Q|
[red]"hello"[/red]
| + if RUBY_VERSION >= "1.9" + out.should == %Q|
[red]"hello"[/red]
| + else + out.should == %Q|
[red]"hello"[/red]
| + end end it "shoud not raise ArgumentError when formatting HTML (shade color)" do