spec/rumble_spec.rb in keynote-0.0.1 vs spec/rumble_spec.rb in keynote-0.1.0
- old
+ new
@@ -10,11 +10,11 @@
include Rumble
def assert_rumble(str, &blk)
exp = str.gsub(/(\s+(<)|>\s+)/) { $2 || '>' }
res = nil
- html {
+ build_html {
res = yield.to_s
}
assert_equal exp, res
assert_instance_of ActiveSupport::SafeBuffer, res
end
@@ -77,20 +77,20 @@
</div>
HTML
assert_rumble str do
div do
- (%w[Hello World].map { |x| html { p x; p x } } * '|').html_safe
+ (%w[Hello World].map { |x| build_html { p x; p x } } * '|').html_safe
end
end
end
def test_capture_raise
assert_raises RuntimeError do
- html {
+ build_html {
div do
- html { raise }
+ build_html { raise }
end
}
end
end
@@ -172,27 +172,27 @@
end
end
def test_error_selfclosing_content
assert_raises Rumble::Error do
- html {
+ build_html {
br "content"
}
end
end
def test_error_css_proxy_continue
assert_raises Rumble::Error do
- html {
+ build_html {
p.one("test").two
}
end
end
# The real test here is if @rumble_context is nil in the teardown.
def test_error_general
assert_raises RuntimeError do
- html {
+ build_html {
div do
raise
end
}
end