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 +8 -8
- data/lib/comparers/equality_comparer.rb +1 -1
- data/lib/test_hook.rb +21 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGJhYTFkYjAyOGRiZDZmMWQxMjcyZGIwNjU5OTVlNjRkZmMwZDlkZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2JkZmE5ZDRhYzY1YzM5MDZjNGJkMmRhNzM3MDM0ZjIxZTYwNjlkMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzIwYTQ3OTYyY2Q0MzVhZmY4OTliNzE0YmI0ZWVlN2RlZTdmOTBkNzJjYjMx
|
10
|
+
YzIxMDkxZWI1MWU4MjVjNzcyZWIxMDcwYmQzMjk3ZmQ2ODdkYzI5NWU4MWU5
|
11
|
+
N2VhYmUxYzJiM2U2OTgxYzEzMGQ2ZmQ0MjlhZDg5NzRlODk0MGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzVmZDZiMGNiOTAxZjY4NWVjMGRkNGNlYzQ0NzM2YTRlYmVkYTE1YTVjNGNm
|
14
|
+
YjBiN2Q1MWJlNjNjNWU1ZmM5NDcwODc5NDcxZTRhNDgzODBjYmFkM2UxYTVh
|
15
|
+
YTEzZWM1NDdlMDdhNDNjNTNhZDRlOWI1ZDJiOGU0YTJiNDRhYjQ=
|
data/lib/test_hook.rb
CHANGED
@@ -2,7 +2,7 @@ require 'mumukit/hook'
|
|
2
2
|
|
3
3
|
class TextTestHook < Mumukit::Hook
|
4
4
|
def compile(request)
|
5
|
-
{
|
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)
|
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
|
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-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|