mumuki-text-runner 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzQxMDdhYjU0MTZjYmJmZjQ0YmE3YmM5ZjI0Y2ZiNzU3ZmY0MjQxMg==
4
+ ZGJhYTFkYjAyOGRiZDZmMWQxMjcyZGIwNjU5OTVlNjRkZmMwZDlkZA==
5
5
  data.tar.gz: !binary |-
6
- YjYzMDM4ZTk5NDAyZGUyZGY0OTFjYWFkMjlkMGE5YWU2MTkzOTkwMw==
6
+ N2JkZmE5ZDRhYzY1YzM5MDZjNGJkMmRhNzM3MDM0ZjIxZTYwNjlkMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTM5ZmRjNWFmYmM0MzhmMDI0NTc2YTM4OTMyZTBmYWMxNGZiNjcyMjdjYjYx
10
- YjBjOWZhZTM2MTg1NWY4MTdjMzU3YjZiMzE1N2YyZWMyMWU0NDhhMGNjNDBm
11
- NjRjNTc1Mzk5OThiODZlMjY0ZWUxOWQ5MzJhN2RjZjRmNTZlYmQ=
9
+ YzIwYTQ3OTYyY2Q0MzVhZmY4OTliNzE0YmI0ZWVlN2RlZTdmOTBkNzJjYjMx
10
+ YzIxMDkxZWI1MWU4MjVjNzcyZWIxMDcwYmQzMjk3ZmQ2ODdkYzI5NWU4MWU5
11
+ N2VhYmUxYzJiM2U2OTgxYzEzMGQ2ZmQ0MjlhZDg5NzRlODk0MGM=
12
12
  data.tar.gz: !binary |-
13
- OGY5NjE5OTc3MWQzZTFmYWRmNTI0MmJmYmYwZDA0YzFiMjBiMDA3YTVjZDc1
14
- YjJiNjU3OTNjZGFlZDE3ODg2YjRlMDFjNzhiMDEzYmEwYTFhYTQwYTFjNGEx
15
- MzcwZjk4MzBlYTU5ZGRjZjRlZmJkMGQ3NTM2ZTU5YTdmNDkzNjc=
13
+ YzVmZDZiMGNiOTAxZjY4NWVjMGRkNGNlYzQ0NzM2YTRlYmVkYTE1YTVjNGNm
14
+ YjBiN2Q1MWJlNjNjNWU1ZmM5NDcwODc5NDcxZTRhNDgzODBjYmFkM2UxYTVh
15
+ YTEzZWM1NDdlMDdhNDNjNTNhZDRlOWI1ZDJiOGU0YTJiNDRhYjQ=
@@ -8,7 +8,7 @@ class EqualityComparer
8
8
 
9
9
  def satisfies?(source)
10
10
  @actual = transform(source)
11
- @actual == @expected
11
+ @actual == transform(@expected)
12
12
  end
13
13
 
14
14
  def locale_error_message
@@ -2,7 +2,7 @@ require 'mumukit/hook'
2
2
 
3
3
  class TextTestHook < Mumukit::Hook
4
4
  def compile(request)
5
- { source: request[:content].strip, examples: parse_test(request[:test]) }
5
+ {source: request[:content].strip, examples: parse_test(request[:test])}
6
6
  end
7
7
 
8
8
  def run!(test_definition)
@@ -17,6 +17,25 @@ class TextTestHook < Mumukit::Hook
17
17
  end
18
18
 
19
19
  def parse_test(tests)
20
- YAML.load(tests).map { |example| example.deep_symbolize_keys }
20
+ parsed_test = YAML.load(tests)
21
+ if parsed_test.is_a? Array
22
+ parse_multi_scenario_test(parsed_test)
23
+ else
24
+ parse_single_scenario_test(parsed_test)
25
+ end
26
+
27
+ end
28
+
29
+ def parse_single_scenario_test(parsed_test)
30
+ [{name: 'test',
31
+ postconditions: {equal: {
32
+ expected: parsed_test['equal'],
33
+ ignore_case: parsed_test['ignore_case'].present?,
34
+ ignore_whitespace: parsed_test['ignore_whitespace'].present?}}
35
+ }]
36
+ end
37
+
38
+ def parse_multi_scenario_test(parsed_test)
39
+ parsed_test.map { |example| example.deep_symbolize_keys }
21
40
  end
22
41
  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.0.1
4
+ version: 1.1.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: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit