-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop extending into ERB the t
and textilize
#19
base: master
Are you sure you want to change the base?
Changes from all commits
85b3dc8
50049da
cdd02b0
a12a118
f58e1a1
a25fa78
a262b5b
7c47155
0b4bcc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
require File.dirname(__FILE__) + '/spec_helper' | ||
require 'redcloth/erb_extension' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Requiring this here requires it globally. Not just for this test. Better would be to create a test class and include it in there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any idea how to do that? To preserve the same functionality (auto-inclustion to the ERB helpers), I believe it's impossible to do. This could be changed to use another module, include it into a |
||
|
||
describe "ERB helper" do | ||
it "should add a textile tag to ERB" do | ||
template = %{<%=t "This new ERB tag makes is so _easy_ to use *RedCloth*" %>} | ||
erb_class = Class.new do | ||
include ERB::Util | ||
|
||
def main | ||
input = %{<%= textilize "This new ERB tag makes is so _easy_ to use *RedCloth*" %>} | ||
ERB.new(input).result(binding) | ||
end | ||
end | ||
|
||
expected = %{<p>This new <span class="caps">ERB</span> tag makes is so <em>easy</em> to use <strong>RedCloth</strong></p>} | ||
|
||
ERB.new(template).result.should == expected | ||
erb_class.new.main.should == expected | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This like also includes
ERB::Util
in the Object class. Even thatt
method is not removed I think this line should be removed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it removed in the commit?