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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb9f720963e478e84f41e49be031589ca06af4684380c9f7573e65a87884af86
4
- data.tar.gz: 575ee6e54a3350ad148ec38c36afaa0c8c6467f88ff558049d19a8d7343b4349
3
+ metadata.gz: 7a786ca7a22c998ce1083b151b4af6c787ceea379c758875edfa872ac7286b3f
4
+ data.tar.gz: 84de80a76d68c83766d8b754fa8d952261c505ee976ca96082de9b3a2d1234ec
5
5
  SHA512:
6
- metadata.gz: d26a4aeb0fc1c77b9566a04299f04029f56976509ceff1b80ae589e21cd36b9670a15e4d4bbf7872c6d599415ada17f23fc48250b046490a68b24fa020b2532c
7
- data.tar.gz: fafac3a131ad24d4c00d3a332c63737df6f0738b1c6f535915edddb1c631f6ed53982c983039ed4b1c0306bf14dddbbffaf529a553cee6f8efe509767d56ce0d
6
+ metadata.gz: 6a1cd7d09736898c8c2af016895e476eb007e4ce5fc068d1fd7babe64a6b396a47c834491cfab38640cef5b5d5d342cadfea18a992ceb5fc65276dba762af431
7
+ data.tar.gz: 74530150dd912358a3159ba12c0538b8565bce9986f7bd64b4cf706e9db70513b83087a1fb3b898a2a82245affedd87fecd5b625b1f4d4d93fb9ebd945fbb21d
@@ -4,7 +4,7 @@ class HtmlExpectationsHook < Mumukit::Hook
4
4
  end
5
5
 
6
6
  def run!(request)
7
- document = Nokogiri::HTML(request.content)
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
@@ -1,3 +1,3 @@
1
1
  module HtmlVersionHook
2
- VERSION = '1.5'
2
+ VERSION = '1.6'
3
3
  end
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.5'
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-13 00:00:00.000000000 Z
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.18'
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.18'
26
+ version: '2.23'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hexp
29
29
  requirement: !ruby/object:Gem::Requirement