mumukit-bridge 3.7.0 → 3.8.1

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: b92856b6d6f1a7760ca0b0b748e94f0db57e3bba72389b61769121644fd60def
4
- data.tar.gz: 12492314955a16949836cd8615697e2cf3e39b9cd65b3616026f2c7e58d40b1a
3
+ metadata.gz: 6889a403cce8b6e167861d4b0ae9c6c085ef55e1ce55116b6e8a02c931255b39
4
+ data.tar.gz: 85f171d7e075aba74feecba7d61ba0a8a5d56a6de6c25c69982e3f58eda0c706
5
5
  SHA512:
6
- metadata.gz: 21f954a58e350c5cedc6d34b519688eb65d727608bfe61dcc53ed23aca5eba1e1c5ed804aea27961ad5c3955ef5912e2fdb7bcc242ebe680e438d6615408a8f9
7
- data.tar.gz: 2cee461421396708169b55c9faeabfd0d31d56faec3786e3a8d9739705daf4fd5fcc6f11220606dd48b0bb37b7b5c536f8c98a9367618670b24be973a874aa33
6
+ metadata.gz: a4a56d718075d48a04349b3ea5dec213b6b9bdecb277aeeebfbbd431b9b31cf82057113f16b71f9f1493fb954f515b7f1cfd8a38680f1817da746567e2dd2563
7
+ data.tar.gz: be9b34edf084d0a056d961930437f79792d332e00110b32ddabc380f0d5e7a87d5bd7340508f582a947f3666fcd05334f244e53d1498bbaae8a9d23938e7f52b
@@ -1,6 +1,6 @@
1
1
  require 'rest_client'
2
2
 
3
- require 'active_support/all'
3
+ require 'mumukit/core'
4
4
 
5
5
  require_relative './bridge/version'
6
6
  require_relative './bridge/runner'
@@ -11,4 +11,4 @@ require_relative './bridge/thesaurus'
11
11
  module Mumukit
12
12
  module Bridge
13
13
  end
14
- end
14
+ end
@@ -1,5 +1,5 @@
1
1
  class Array
2
2
  def fetch_mumuki_status(key)
3
- all? { |it| it[key] == :passed }.to_mumuki_status
3
+ all? { |it| it[key].passed? }.to_mumuki_status
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ module Mumukit::Bridge
12
12
  end
13
13
 
14
14
  def global_status(test_status, expectation_status, request)
15
- if test_status == :passed && expectation_status == :failed
15
+ if test_status.passed? && expectation_status.failed?
16
16
  request[:test].blank? ? :failed : :passed_with_warnings
17
17
  else
18
18
  test_status
@@ -39,10 +39,10 @@ module Mumukit::Bridge
39
39
  private
40
40
 
41
41
  def parse_test_results(results)
42
- results.map { |it| {
43
- title: it['title'],
44
- status: it['status'].to_sym,
45
- result: it['result']} }
42
+ results.map { |it| {
43
+ title: it['title'],
44
+ status: it['status'].to_sym,
45
+ result: it['result']} }
46
46
  end
47
47
  end
48
48
 
@@ -54,12 +54,36 @@ module Mumukit::Bridge
54
54
  end
55
55
  end
56
56
 
57
+ class Mixed < Structured
58
+ def build_hash(response)
59
+ structured_results = super(response)
60
+ structured_results.merge response_type: :mixed,
61
+ status: status(structured_results[:status], response['exit'].to_sym)
62
+ end
63
+
64
+ private
65
+
66
+ def status(tests_status, output_status)
67
+ tests_status.passed? && output_status.passed? ? :passed : :failed
68
+ end
69
+ end
70
+
57
71
  def self.structured_test_results?(response)
58
72
  response['testResults'].present?
59
73
  end
60
74
 
75
+ def self.mixed_test_results?(response)
76
+ structured_test_results?(response) && response['out'].present?
77
+ end
78
+
61
79
  def self.for_response(response)
62
- structured_test_results?(response) ? Structured.new : Unstructured.new
80
+ if mixed_test_results?(response)
81
+ Mixed.new
82
+ elsif structured_test_results?(response)
83
+ Structured.new
84
+ else
85
+ Unstructured.new
86
+ end
63
87
  end
64
88
  end
65
89
  end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Bridge
3
- VERSION = '3.7.0'
3
+ VERSION = '3.8.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.8.1
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-09-14 00:00:00.000000000 Z
11
+ date: 2018-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: '1.3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: '1.3'
83
83
  description:
84
84
  email:
85
85
  - flbulgarelli@yahoo.com.ar
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.7.7
118
+ rubygems_version: 2.7.8
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Library for connecting to a Mumuki test runner