mumuki-text-runner 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43678016289325cc51c7f82a3c3696d8113641032b2c1b97f4a68ce4835bc3c6
4
- data.tar.gz: b237d0b7ec9d0fe5e8dc110accf493fbd17ac35d55bb3f2e14856b1f277922f9
3
+ metadata.gz: 5b6cf60acdbbbea2a93591a35f6798f31e97138768b7f715f9be0b5fdd945901
4
+ data.tar.gz: 38891926782f7edb4d5a40928162ae66e507727c7dda9b35cd72840e33853239
5
5
  SHA512:
6
- metadata.gz: 134703fbbf89aa87c224e1efa93752e7f7681b82586ce56325b31cd342ac72fda98ba38136a747b54e9e635068e372f0236fe837caa569f6b1072048719e4371
7
- data.tar.gz: a224bb63533f2f352c4a4be7cfa51ea9030a6fe7c3d0258bfb15a63f711678994fa60007207ee1823960c0dc1b60b9ccda5ac0d339c395400de98abc42e02f2e
6
+ metadata.gz: d8f03d8e82ebf3bd9e72aef871e5aa2e429d022c0d332a3f59cd6e6067346618dc1b43d850fa096d803fd97b22a8e037ce60ecec581c094ed35b0cf8bea9de5e
7
+ data.tar.gz: 5515417742c30efe5b90b2b3675ce565950d8056ee51b0c3e84bc5f08a0533628144a1f265b2dce6d6f95e04af7a6e5a2dba13fa929071f58d3f73da356fd024
data/lib/checker.rb CHANGED
@@ -5,8 +5,10 @@ class TextChecker < Mumukit::Metatest::Checker
5
5
  require_relative './comparators/regexp_comparator'
6
6
  require_relative './comparators/valid_ip_comparator'
7
7
 
8
- require_relative './options/ignore_whitespace'
8
+ require_relative './options/lenient_blank'
9
9
  require_relative './options/ignore_case'
10
+ require_relative './options/ignore_whitespace'
11
+ require_relative './options/multiline'
10
12
 
11
13
  COMPARATORS = {
12
14
  match: TextChecker::RegexpComparator,
@@ -15,8 +15,10 @@ class TextChecker::Comparator
15
15
 
16
16
  def modifiers
17
17
  modifiers = []
18
- modifiers << TextChecker::IgnoreWhitespace if @config[:ignore_whitespace]
19
18
  modifiers << TextChecker::IgnoreCase if @config[:ignore_case]
19
+ modifiers << TextChecker::LenientBlank if @config[:lenient_blank]
20
+ modifiers << TextChecker::IgnoreWhitespace if @config[:ignore_whitespace]
21
+ modifiers << TextChecker::Multiline if @config[:multiline]
20
22
  modifiers
21
23
  end
22
24
 
@@ -0,0 +1,5 @@
1
+ module TextChecker::LenientBlank
2
+ def self.apply(text)
3
+ text.gsub("\t", ' ').squeeze(' ')
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TextChecker::Multiline
2
+ def self.apply(text)
3
+ text.gsub("\r\n", "\n")
4
+ end
5
+ end
data/lib/test_hook.rb CHANGED
@@ -30,7 +30,9 @@ class TextTestHook < Mumukit::Hook
30
30
  postconditions: { equal: {
31
31
  expected: parsed_test['equal'],
32
32
  ignore_case: parsed_test['ignore_case'].present?,
33
- ignore_whitespace: parsed_test['ignore_whitespace'].present? } }
33
+ ignore_whitespace: parsed_test['ignore_whitespace'].present?,
34
+ lenient_blank: parsed_test['lenient_blank'].present?,
35
+ multiline: parsed_test['multiline'].present? } }
34
36
  }]
35
37
  end
36
38
 
data/lib/version_hook.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TextVersionHook
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-text-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
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: 2020-07-14 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -126,6 +126,8 @@ files:
126
126
  - lib/metadata_hook.rb
127
127
  - lib/options/ignore_case.rb
128
128
  - lib/options/ignore_whitespace.rb
129
+ - lib/options/lenient_blank.rb
130
+ - lib/options/multiline.rb
129
131
  - lib/test_hook.rb
130
132
  - lib/text_runner.rb
131
133
  - lib/version_hook.rb
@@ -148,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
150
  - !ruby/object:Gem::Version
149
151
  version: '0'
150
152
  requirements: []
151
- rubyforge_project:
152
- rubygems_version: 2.7.7
153
+ rubygems_version: 3.0.3
153
154
  signing_key:
154
155
  specification_version: 4
155
156
  summary: Text Runner for Mumuki