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