sbfaulkner-sinatra-markaby 0.9.2.1 → 0.9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/test/sinatra_markaby_test.rb +16 -7
- metadata +1 -1
data/VERSION.yml
CHANGED
|
@@ -14,36 +14,45 @@ class SinatraMarkabyTest < Test::Unit::TestCase
|
|
|
14
14
|
def test_renders_inline_strings
|
|
15
15
|
markaby_app { markaby 'mab.p "Hello shrimp!"' }
|
|
16
16
|
assert last_response.ok?
|
|
17
|
-
assert_equal
|
|
17
|
+
assert_equal '<p>Hello shrimp!</p>', last_response.body
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def test_renders_inline_blocks
|
|
21
21
|
markaby_app {
|
|
22
|
-
@name =
|
|
22
|
+
@name = 'Frank & Mary'
|
|
23
23
|
markaby do |mab|
|
|
24
24
|
mab.p "Hello #{@name}!"
|
|
25
25
|
end
|
|
26
26
|
}
|
|
27
27
|
assert last_response.ok?
|
|
28
|
-
assert_equal
|
|
28
|
+
assert_equal '<p>Hello Frank & Mary!</p>', last_response.body
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def test_renders_markaby_files_in_views_path
|
|
32
32
|
markaby_app {
|
|
33
|
-
@name =
|
|
33
|
+
@name = 'World'
|
|
34
34
|
markaby :hello
|
|
35
35
|
}
|
|
36
36
|
assert last_response.ok?
|
|
37
|
-
assert_equal
|
|
37
|
+
assert_equal '<p>Hello, World!</p>', last_response.body
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def test_renders_in_file_template
|
|
41
41
|
markaby_app {
|
|
42
|
-
@name =
|
|
42
|
+
@name = 'Joe'
|
|
43
43
|
markaby :in_file
|
|
44
44
|
}
|
|
45
45
|
assert last_response.ok?
|
|
46
|
-
assert_equal
|
|
46
|
+
assert_equal '<p>Hey Joe</p>', last_response.body
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def test_renders_with_layout
|
|
50
|
+
markaby_app {
|
|
51
|
+
@name = 'with Layout'
|
|
52
|
+
markaby :hello, :layout => :html
|
|
53
|
+
}
|
|
54
|
+
assert last_response.ok?
|
|
55
|
+
assert_equal '<html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>Hello</title></head><body><p>Hello, with Layout!</p></body></html>', last_response.body
|
|
47
56
|
end
|
|
48
57
|
|
|
49
58
|
def test_raises_error_if_template_not_found
|