spec/inline_spec.rb in keynote-0.2.0pre2 vs spec/inline_spec.rb in keynote-0.2.0pre3
- old
+ new
@@ -14,11 +14,11 @@
str.gsub(/\s/, "")
end
class InlineUser < Keynote::Presenter
extend Keynote::Inline
- inline :erb, :slim, :haml
+ inline :slim, :haml
def simple_template
erb
# Here's some math: <%= 2 + 2 %>
end
@@ -51,12 +51,13 @@
# <% raise "UH OH" %>
end
def fix_indentation
slim
- # div.indented_slightly
- # = "hello"
+ # .indented_slightly
+ # - (2..4).each do |i|
+ # ' #{i} times
end
def erb_escaping
erb +
# <%= "<script>alert(1);</script>" %>
@@ -98,11 +99,11 @@
it "should see locals passed in as a binding" do
presenter.locals_from_binding.strip.must_equal "Local H"
end
it "should be able to call other methods from the same object" do
- presenter.method_calls.strip.squeeze(" ").must_equal "Local H Local H"
+ presenter.method_calls.strip.squeeze(" ").must_equal "Local H\nLocal H"
end
it "should handle errors relatively gracefully" do
begin
presenter.error_handling
@@ -114,10 +115,10 @@
e.original_exception.message.must_equal "UH OH"
end
it "should remove leading indentation" do
presenter.fix_indentation.must_equal \
- "<div class=\"indented_slightly\">hello</div>"
+ "<div class=\"indented_slightly\">2 times 3 times 4 times </div>"
end
it "should escape HTML by default" do
unescaped = "<script>alert(1);</script>"
escaped = unescaped.gsub(/</, "<").gsub(/>/, ">")