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:
parent
edee37c5c7
commit
9b655ad63a
1 changed files with 6 additions and 2 deletions
|
@ -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|<pre>[red]<kbd style="color:red">"hello"</kbd>[/red]</pre>|
|
||||
if RUBY_VERSION >= "1.9"
|
||||
out.should == %Q|<pre>[red]<kbd style="color:red">"hello"</kbd>[/red]</pre>|
|
||||
else
|
||||
out.should == %Q|<pre>[red]"hello"[/red]</pre>|
|
||||
end
|
||||
end
|
||||
|
||||
it "shoud not raise ArgumentError when formatting HTML (shade color)" do
|
||||
|
|
Loading…
Reference in a new issue