haml-edge 2.3.35 → 2.3.36
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/EDGE_GEM_VERSION +1 -1
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/test/haml/spec_test.rb +22 -10
- metadata +2 -2
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.36
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.36
|
data/test/haml/spec_test.rb
CHANGED
@@ -9,24 +9,36 @@ end
|
|
9
9
|
class SpecTest < Test::Unit::TestCase
|
10
10
|
spec_file = File.dirname(__FILE__) + '/spec/tests.json'
|
11
11
|
if !File.exists?(spec_file)
|
12
|
-
|
12
|
+
error = <<MSG.rstrip
|
13
13
|
Couldn't load haml-spec, skipping some tests.
|
14
14
|
To use haml-spec, run `git submodule update --init`
|
15
15
|
MSG
|
16
16
|
elsif !defined?(JSON)
|
17
|
-
|
17
|
+
error = "Couldn't load json, skipping some tests."
|
18
|
+
end
|
19
|
+
|
20
|
+
if error
|
21
|
+
define_method(:test_fake_couldnt_load_spec) {warn("\n" + error)}
|
18
22
|
else
|
19
23
|
JSON.parse(File.read(spec_file)).each do |name, tests|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
tests.each do |subname, test|
|
25
|
+
define_method("test_spec: #{name} (#{subname})") do
|
26
|
+
options = convert_hash(test["config"])
|
27
|
+
options[:format] = options[:format].to_sym if options[:format]
|
28
|
+
engine = Haml::Engine.new(test["haml"], options)
|
29
|
+
|
30
|
+
result = engine.render(Object.new, convert_hash(test["locals"]))
|
31
|
+
|
32
|
+
assert_equal(test["html"], result.rstrip)
|
28
33
|
end
|
29
34
|
end
|
30
35
|
end
|
31
36
|
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def convert_hash(hash)
|
41
|
+
return {} unless hash
|
42
|
+
Haml::Util.map_keys(hash) {|k| k.to_sym}
|
43
|
+
end
|
32
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-09-
|
13
|
+
date: 2009-09-20 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|