mumukit 2.45.0 → 2.46.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: 4c4daef670d7b72e6a88cea099905e870f6534ba9d7da574323efc941e8e991e
4
- data.tar.gz: 7293bd7160ff5249f5c06f45f34c4bfb87df2ee24128aefda1dbf421ad6be9cd
3
+ metadata.gz: 4373e0933cc618f5296133f601a28fc2a32497f072ebcef924bdb54757d54d5c
4
+ data.tar.gz: b31b3f50fa6e859b7815fc75d7da804b72146eceb35c3dff7c5b7558c5c61c23
5
5
  SHA512:
6
- metadata.gz: 723eff33716d123138cc159cb3724e554e714bf8da1024afec1372033778488cb0f0c9ea9f3a555aa14a02610375ca4f674de79089d45ebfe8e3c8cbb234391f
7
- data.tar.gz: b214cfcc02b1a24f81c4f34ed2d39865fe79d6a56a7fd73c79ef6902cb7218ad29b90deed1a408d58164f1d202fe088f35831a70ceb32bf6f235aaacb9a1821c
6
+ metadata.gz: e58de2ec660e81837568e02e13a1b2f7cb86f9fde5b607a761a130354df7bb7fa5acf364bb14a8819edc69c349f6a3c70a5e1ee98e627563d193935d7a7ff756
7
+ data.tar.gz: 8536f6834bc8c8d643084701c1cc509772b35780a9a3a89ea7c69ba57e23021a5961cf01fb9b13fd90bbcab0f105a6f6484b60ba18646916cbab63421f68da26
data/lib/locales/en.yml CHANGED
@@ -15,5 +15,5 @@ en:
15
15
  check_query_outputs: "query '%{query}' output should be '%{expected}' but was '%{actual}'"
16
16
  check_query_passes: "query '%{query}' should pass but it failed"
17
17
  goal_passed: "goal was met successfully"
18
- check_queries_match: "All the required queries must be executed"
19
- check_queries_equal: "All the required queries must be executed"
18
+ check_queries_match: "All the required queries must be executed. Executed %{all} but only %{matches} match the expectations"
19
+ check_queries_equal: "All the required queries must be executed. Executed %{all} but only %{matches} match the expectations"
@@ -15,5 +15,5 @@ es-CL:
15
15
  check_query_outputs: "La consulta '%{query}' debería devolver '%{expected}' pero devolvió '%{actual}'"
16
16
  check_query_passes: "La consulta '%{query}' debería pasar pero falló"
17
17
  goal_passed: "El objetivo se cumplió exitosamente"
18
- check_queries_match: "Se deben realizar todas las consultas solicitadas"
19
- check_queries_equal: "Se deben realizar todas las consultas solicitadas"
18
+ check_queries_match: "Se deben realizar todas las consultas solicitadas. Se ejecutaron %{all} pero sólo %{matches} coinciden con las solicitadas"
19
+ check_queries_equal: "Se deben realizar todas las consultas solicitadas. Se ejecutaron %{all} pero sólo %{matches} coinciden con las solicitadas"
data/lib/locales/es.yml CHANGED
@@ -15,5 +15,5 @@ es:
15
15
  check_query_outputs: "La consulta '%{query}' debería devolver '%{expected}' pero devolvió '%{actual}'"
16
16
  check_query_passes: "La consulta '%{query}' debería pasar pero falló"
17
17
  goal_passed: "El objetivo se cumplió exitosamente"
18
- check_queries_match: "Se deben realizar todas las consultas solicitadas"
19
- check_queries_equal: "Se deben realizar todas las consultas solicitadas"
18
+ check_queries_match: "Se deben realizar todas las consultas solicitadas. Se ejecutaron %{all} pero sólo %{matches} coinciden con las solicitadas"
19
+ check_queries_equal: "Se deben realizar todas las consultas solicitadas. Se ejecutaron %{all} pero sólo %{matches} coinciden con las solicitadas"
data/lib/locales/pt.yml CHANGED
@@ -14,6 +14,6 @@ pt:
14
14
  check_query_fails: "a consulta '%{query}' deve falhar, mas passou"
15
15
  check_query_outputs: "a consulta '%{query}' deve ser '%{expected}', mas foi '%{actual}'"
16
16
  check_query_passes: "a consulta '%{query}' deve passar, mas falhou"
17
- check_queries_match: "Todas as consultas solicitadas devem ser feitas"
18
- check_queries_equal: "Todas as consultas solicitadas devem ser feitas"
17
+ check_queries_match: "Todas as consultas solicitadas devem ser feitas. %{all} foram feitas mas só %{matches} correspondem com as solicitadas"
18
+ check_queries_equal: "Todas as consultas solicitadas devem ser feitas. %{all} foram feitas mas só %{matches} correspondem com as solicitadas"
19
19
  goal_passed: "O objetivo foi alcançado com sucesso"
@@ -24,15 +24,17 @@ module Mumukit::Metatest
24
24
  end
25
25
 
26
26
  def check_queries_equal(result, goal)
27
- fail_t :check_queries_equal unless goal[:values].all? do |regexp|
28
- queries.any? { |query| query == regexp }
29
- end
27
+ matches = goal[:values].map do |value|
28
+ queries.find { |query| query == value }
29
+ end.compact
30
+ fail_queries_t :check_queries_equal, queries, matches, goal[:values]
30
31
  end
31
32
 
32
33
  def check_queries_match(result, goal)
33
- fail_t :check_queries_match unless goal[:regexps].all? do |regexp|
34
- queries.any? { |query| query.match? regexp }
35
- end
34
+ matches = goal[:regexps].map do |regexp|
35
+ queries.find { |query| query.match? regexp }
36
+ end.compact
37
+ fail_queries_t :check_queries_match, queries, matches, goal[:regexps]
36
38
  end
37
39
 
38
40
  def check_last_query_outputs(result, goal)
@@ -90,6 +92,14 @@ module Mumukit::Metatest
90
92
 
91
93
  private
92
94
 
95
+ def join_queries(queries)
96
+ queries.map { |it| "`#{it}`" }.join(", ").presence || '**∅**'
97
+ end
98
+
99
+ def fail_queries_t(key, queries, matches, expectations)
100
+ fail_t key, all: join_queries(queries), matches: join_queries(matches) unless matches.size == expectations.size
101
+ end
102
+
93
103
  def query
94
104
  strip @request.query.to_s
95
105
  end
@@ -1,3 +1,3 @@
1
1
  module Mumukit
2
- VERSION = '2.45.0'
2
+ VERSION = '2.46.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.45.0
4
+ version: 2.46.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: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler