koara-html 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.gitmodules +3 -0
- data/.travis.yml +8 -0
- data/Gemfile +5 -0
- data/LICENSE +202 -0
- data/README.md +40 -0
- data/Rakefile +11 -0
- data/koara-html.gemspec +20 -0
- data/lib/koara/html.rb +8 -0
- data/lib/koara/html/html5renderer.rb +197 -0
- data/test/compliance_test.rb +31 -0
- data/test/end_to_end_test.rb +1050 -0
- data/test/html5renderer_test.rb +31 -0
- metadata +80 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'koara'
|
2
|
+
require 'koara/html/html5renderer'
|
3
|
+
require 'minitest/autorun'
|
4
|
+
|
5
|
+
class Html5RendererTest < MiniTest::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
parser = Koara::Parser.new
|
9
|
+
@document = parser.parse('Test')
|
10
|
+
@renderer = Koara::Html::Html5Renderer.new()
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_basic
|
14
|
+
@document.accept(@renderer)
|
15
|
+
assert_equal("<p>Test</p>", @renderer.output)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_no_partial_result
|
19
|
+
expected = "<!DOCTYPE html>\n"
|
20
|
+
expected << "<html>\n";
|
21
|
+
expected << " <body>\n";
|
22
|
+
expected << " <p>Test</p>\n";
|
23
|
+
expected << " </body>\n";
|
24
|
+
expected << "</html>\n";
|
25
|
+
|
26
|
+
@renderer.partial = false;
|
27
|
+
@document.accept(@renderer)
|
28
|
+
assert_equal(expected, @renderer.output)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: koara-html
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andy Van Den Heuvel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '10.4'
|
20
|
+
- - '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 10.4.2
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '10.4'
|
30
|
+
- - '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 10.4.2
|
33
|
+
description: Koara to HTML parser written in Ruby
|
34
|
+
email:
|
35
|
+
- andy.vandenheuvel@gmail.com
|
36
|
+
executables: []
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- .gitignore
|
41
|
+
- .gitmodules
|
42
|
+
- .travis.yml
|
43
|
+
- Gemfile
|
44
|
+
- LICENSE
|
45
|
+
- README.md
|
46
|
+
- Rakefile
|
47
|
+
- koara-html.gemspec
|
48
|
+
- lib/koara/html.rb
|
49
|
+
- lib/koara/html/html5renderer.rb
|
50
|
+
- test/compliance_test.rb
|
51
|
+
- test/end_to_end_test.rb
|
52
|
+
- test/html5renderer_test.rb
|
53
|
+
homepage: https://github.com/koara/koara-rb-html
|
54
|
+
licenses:
|
55
|
+
- Apache-2.0
|
56
|
+
metadata: {}
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 2.6.4
|
74
|
+
signing_key:
|
75
|
+
specification_version: 4
|
76
|
+
summary: Koara to HTML parser written in Ruby
|
77
|
+
test_files:
|
78
|
+
- test/compliance_test.rb
|
79
|
+
- test/end_to_end_test.rb
|
80
|
+
- test/html5renderer_test.rb
|