mumuki-html-runner 1.5 → 1.6
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.
- checksums.yaml +4 -4
- data/lib/expectations_hook.rb +5 -1
- data/lib/html_runner.rb +2 -0
- data/lib/test_hook.rb +1 -2
- data/lib/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a786ca7a22c998ce1083b151b4af6c787ceea379c758875edfa872ac7286b3f
|
4
|
+
data.tar.gz: 84de80a76d68c83766d8b754fa8d952261c505ee976ca96082de9b3a2d1234ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a1cd7d09736898c8c2af016895e476eb007e4ce5fc068d1fd7babe64a6b396a47c834491cfab38640cef5b5d5d342cadfea18a992ceb5fc65276dba762af431
|
7
|
+
data.tar.gz: 74530150dd912358a3159ba12c0538b8565bce9986f7bd64b4cf706e9db70513b83087a1fb3b898a2a82245affedd87fecd5b625b1f4d4d93fb9ebd945fbb21d
|
data/lib/expectations_hook.rb
CHANGED
@@ -4,7 +4,7 @@ class HtmlExpectationsHook < Mumukit::Hook
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def run!(request)
|
7
|
-
document = Nokogiri::HTML(request
|
7
|
+
document = Nokogiri::HTML(compile_content(request))
|
8
8
|
request.expectations.map do |raw|
|
9
9
|
expectation = Mumukit::Inspection::Expectation.parse(raw.with_indifferent_access)
|
10
10
|
binding = expectation.binding.gsub(/(css:)|(html:)/, '')
|
@@ -16,6 +16,10 @@ class HtmlExpectationsHook < Mumukit::Hook
|
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
|
+
def compile_content(request)
|
20
|
+
request.content.presence || request.extra
|
21
|
+
end
|
22
|
+
|
19
23
|
def negate(expectation, matches)
|
20
24
|
expectation.inspection.negated? ? matches.blank? : matches.present?
|
21
25
|
end
|
data/lib/html_runner.rb
CHANGED
@@ -9,6 +9,8 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
|
|
9
9
|
Mumukit.runner_name = 'html'
|
10
10
|
Mumukit.configure do |config|
|
11
11
|
config.content_type = 'html'
|
12
|
+
config.process_expectations_on_empty_content = true
|
13
|
+
config.run_test_hook_on_empty_test = true
|
12
14
|
end
|
13
15
|
|
14
16
|
require_relative './metadata_hook'
|
data/lib/test_hook.rb
CHANGED
@@ -14,8 +14,7 @@ class HtmlTestHook < Mumukit::Hook
|
|
14
14
|
def run!(request)
|
15
15
|
expected = request[:test]
|
16
16
|
actual = request[:extra] || request[:content]
|
17
|
-
|
18
|
-
if contents_match?(expected, actual)
|
17
|
+
if expected.blank? || contents_match?(expected, actual)
|
19
18
|
[render_html(actual), :passed]
|
20
19
|
else
|
21
20
|
[render_fail_html(actual, expected), :failed]
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-html-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.23'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.23'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hexp
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|