mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
25 lines
738 B
Ruby
25 lines
738 B
Ruby
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
|
|
begin
|
|
require 'action_view'
|
|
require 'awesome_print/ext/action_view'
|
|
|
|
describe "AwesomePrint ActionView extensions" do
|
|
before do
|
|
@view = ActionView::Base.new
|
|
end
|
|
|
|
it "uses HTML and adds 'debug_dump' class to plain <pre> tag" do
|
|
markup = rand
|
|
@view.ap(markup, :plain => true).should == %Q|<pre class="debug_dump">#{markup}</pre>|
|
|
end
|
|
|
|
it "uses HTML and adds 'debug_dump' class to colorized <pre> tag" do
|
|
markup = ' &<hello>'
|
|
@view.ap(markup).should == '<pre class="debug_dump" style="color:brown">" &<hello>"</pre>'
|
|
end
|
|
end
|
|
|
|
rescue LoadError
|
|
puts "Skipping ActionView specs..."
|
|
end
|