1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Small spec tweak for Ruby 1.8.x

This commit is contained in:
Mike Dvorkin 2012-09-05 22:25:52 -07:00
parent edee37c5c7
commit 9b655ad63a

View file

@ -127,7 +127,7 @@ EOS
@awesome_method = "".method(:red) @awesome_method = "".method(:red)
String.instance_eval do 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]" "[red]#{self}[/red]"
end end
end end
@ -142,7 +142,11 @@ EOS
it "shoud not raise ArgumentError when formatting HTML" do it "shoud not raise ArgumentError when formatting HTML" do
out = "hello".ai(:color => { :string => :red }, :html => true) out = "hello".ai(:color => { :string => :red }, :html => true)
out.should == %Q|<pre>[red]<kbd style="color:red">&quot;hello&quot;</kbd>[/red]</pre>| if RUBY_VERSION >= "1.9"
out.should == %Q|<pre>[red]<kbd style="color:red">&quot;hello&quot;</kbd>[/red]</pre>|
else
out.should == %Q|<pre>[red]&quot;hello&quot;[/red]</pre>|
end
end end
it "shoud not raise ArgumentError when formatting HTML (shade color)" do it "shoud not raise ArgumentError when formatting HTML (shade color)" do