mumukit 2.44.0 → 2.45.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: 027a4f91a42c7b90c17b418228e73956f751f707e51d6ded4c4802126f25d1c4
4
- data.tar.gz: e6fe7203e99fecf139597da9b5c833717b49af81a1cd5402d05fd6d752f9e7f3
3
+ metadata.gz: 4c4daef670d7b72e6a88cea099905e870f6534ba9d7da574323efc941e8e991e
4
+ data.tar.gz: 7293bd7160ff5249f5c06f45f34c4bfb87df2ee24128aefda1dbf421ad6be9cd
5
5
  SHA512:
6
- metadata.gz: cc83fce40d4e6c02abbdc0fb05dbc481d8eab5538d4cd7109646a853cc2b4f88e168569857eafe02be21c7a76fb2e3214d7a048b49f170563c5c07f6a2eaecc8
7
- data.tar.gz: 67ab25ad98d772145044d999bcc6af135d314c5102293b3604fcfb4c50dc0e34ef4d1fe6d9ddde428999a73fadd40a5942fd5a2f0905be59f3266b5543544ede
6
+ metadata.gz: 723eff33716d123138cc159cb3724e554e714bf8da1024afec1372033778488cb0f0c9ea9f3a555aa14a02610375ca4f674de79089d45ebfe8e3c8cbb234391f
7
+ data.tar.gz: b214cfcc02b1a24f81c4f34ed2d39865fe79d6a56a7fd73c79ef6902cb7218ad29b90deed1a408d58164f1d202fe088f35831a70ceb32bf6f235aaacb9a1821c
data/lib/locales/en.yml CHANGED
@@ -5,14 +5,15 @@ en:
5
5
  masked_tempfile_basename: solution
6
6
  interactive:
7
7
  check_last_query_equals: "query should be '%{expected}' but was '%{actual}'"
8
- check_last_query_fails: "query should fail but it passed"
9
- check_last_query_matches: "query does not match regexp %{regexp}"
8
+ check_last_query_fails: "query should fail but it was '%{actual}' and passed"
9
+ check_last_query_matches: "query should match regexp %{regexp}, but was '%{actual}'"
10
10
  check_last_query_outputs: "query output should be '%{expected}' but was '%{actual}'"
11
- check_last_query_includes: "query output should include '%{expected}' but was '%{actual}'"
12
- check_last_query_like: "query output should be like '%{expected}' but was '%{actual}'"
13
- check_last_query_passes: "query should pass but it failed"
11
+ check_last_query_output_includes: "query output should include '%{expected}' but was '%{actual}'"
12
+ check_last_query_output_like: "query output should be like '%{expected}' but was '%{actual}'"
13
+ check_last_query_passes: "query should pass but it was '%{actual}' and failed"
14
14
  check_query_fails: "query '%{query}' should fail but it passed"
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
18
  check_queries_match: "All the required queries must be executed"
19
+ check_queries_equal: "All the required queries must be executed"
@@ -5,14 +5,15 @@ es-CL:
5
5
  masked_tempfile_basename: solucion
6
6
  interactive:
7
7
  check_last_query_equals: "La consulta debería ser '%{expected}' pero fue '%{actual}'"
8
- check_last_query_fails: "La consulta debería fallar pero pasó"
9
- check_last_query_matches: "La consulta no cumple con la expresión regular %{regexp}"
8
+ check_last_query_fails: "La consulta debería fallar pero fue '%{actual}' y pasó"
9
+ check_last_query_matches: "La consulta debería cumplir con la expresión regular '%{regexp}' pero fue '%{actual}'"
10
10
  check_last_query_outputs: "La consulta debería devolver '%{expected}' pero devolvió '%{actual}'"
11
- check_last_query_includes: "La consulta debería incluir '%{expected}' pero devolvió '%{actual}'"
12
- check_last_query_like: "La consulta debería ser como '%{expected}' pero devolvió '%{actual}'"
13
- check_last_query_passes: "La consulta debería pasar pero falló"
11
+ check_last_query_output_includes: "El retorno de la consulta debería incluir '%{expected}' pero devolvió '%{actual}'"
12
+ check_last_query_output_like: "El retorno de la consulta debería ser como '%{expected}' pero devolvió '%{actual}'"
13
+ check_last_query_passes: "La consulta debería pasar pero fue '%{actual}' y falló"
14
14
  check_query_fails: "La consulta '%{query}' debería fallar pero pasó"
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
18
  check_queries_match: "Se deben realizar todas las consultas solicitadas"
19
+ check_queries_equal: "Se deben realizar todas las consultas solicitadas"
data/lib/locales/es.yml CHANGED
@@ -5,14 +5,15 @@ es:
5
5
  masked_tempfile_basename: solucion
6
6
  interactive:
7
7
  check_last_query_equals: "La consulta debería ser '%{expected}' pero fue '%{actual}'"
8
- check_last_query_fails: "La consulta debería fallar pero pasó"
9
- check_last_query_matches: "La consulta no cumple con la expresión regular %{regexp}"
8
+ check_last_query_fails: "La consulta debería fallar pero fue '%{actual}' y pasó"
9
+ check_last_query_matches: "La consulta debería cumplir con la expresión regular '%{regexp}' pero fue '%{actual}'"
10
10
  check_last_query_outputs: "La consulta debería devolver '%{expected}' pero devolvió '%{actual}'"
11
- check_last_query_includes: "La consulta debería incluir '%{expected}' pero devolvió '%{actual}'"
12
- check_last_query_like: "La consulta debería ser como '%{expected}' pero devolvió '%{actual}'"
13
- check_last_query_passes: "La consulta debería pasar pero falló"
11
+ check_last_query_output_includes: "El retorno de la consulta debería incluir '%{expected}' pero devolvió '%{actual}'"
12
+ check_last_query_output_like: "El retorno de la consulta debería ser como '%{expected}' pero devolvió '%{actual}'"
13
+ check_last_query_passes: "La consulta debería pasar pero fue '%{actual}' y falló"
14
14
  check_query_fails: "La consulta '%{query}' debería fallar pero pasó"
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
- check_queries_match: "Se deben realizar todas las consultas solicitadas"
18
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"
data/lib/locales/pt.yml CHANGED
@@ -5,14 +5,15 @@ pt:
5
5
  masked_tempfile_basename: solução
6
6
  interactive:
7
7
  check_last_query_equals: "a consulta deve ser '%{expected}' mas foi '%{actual}'"
8
- check_last_query_fails: "a consulta deve falhar, mas passou"
9
- check_last_query_matches: "A consulta não corresponde a regex %{regexp}"
8
+ check_last_query_fails: "a consulta deve falhar, mas foi '%{actual}' e passou"
9
+ check_last_query_matches: "A consulta deve corresponder a regex %{regexp} mas foi '%{actual}'"
10
10
  check_last_query_outputs: "O resultado da consulta deve ser '%{expected}', mas foi '%{actual}'"
11
- check_last_query_includes: "O resultado da consulta deve incluir '%{expected}', mas foi '%{actual}'"
12
- check_last_query_like: "O resultado da consulta deve ser como '%{expected}', mas foi '%{actual}'"
13
- check_last_query_passes: "A consulta deve passar, mas falhou"
11
+ check_last_query_output_includes: "O resultado da consulta deve incluir '%{expected}', mas foi '%{actual}'"
12
+ check_last_query_output_like: "O resultado da consulta deve ser como '%{expected}', mas foi '%{actual}'"
13
+ check_last_query_passes: "A consulta deve passar, mas foi '%{actual}' e falhou"
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
17
  check_queries_match: "Todas as consultas solicitadas devem ser feitas"
18
+ check_queries_equal: "Todas as consultas solicitadas devem ser feitas"
18
19
  goal_passed: "O objetivo foi alcançado com sucesso"
@@ -14,15 +14,22 @@ module Mumukit::Metatest
14
14
 
15
15
  def check_last_query_matches(_result, goal)
16
16
  regexp = goal[:regexp]
17
- fail_t :check_last_query_matches, regexp: regexp.inspect unless query.match?(regexp)
17
+ actual = query
18
+ fail_t :check_last_query_matches, regexp: regexp.inspect, actual: actual unless query.match?(regexp)
18
19
  end
19
20
 
20
21
  def check_last_query_fails(result, _goal)
21
- fail_t :check_last_query_fails unless result[:query][:status].failed?
22
+ actual = query
23
+ fail_t :check_last_query_fails, actual: actual unless result[:query][:status].failed?
24
+ end
25
+
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
22
30
  end
23
31
 
24
32
  def check_queries_match(result, goal)
25
- queries = [query] + @request.cookie.to_a
26
33
  fail_t :check_queries_match unless goal[:regexps].all? do |regexp|
27
34
  queries.any? { |query| query.match? regexp }
28
35
  end
@@ -47,7 +54,8 @@ module Mumukit::Metatest
47
54
  end
48
55
 
49
56
  def check_last_query_passes(result, _goal)
50
- fail_t :check_last_query_passes unless result[:query][:status].passed?
57
+ actual = query
58
+ fail_t :check_last_query_passes, actual: actual unless result[:query][:status].passed?
51
59
  end
52
60
 
53
61
  def check_query_passes(result, goal)
@@ -83,8 +91,30 @@ module Mumukit::Metatest
83
91
  private
84
92
 
85
93
  def query
86
- query_s = @request.query.to_s
87
- @strip_mode == :right_only ? query_s.rstrip : query_s.strip
94
+ strip @request.query.to_s
95
+ end
96
+
97
+ def cookie
98
+ @request.cookie.to_a.map { |it| strip it }
99
+ end
100
+
101
+ def strip(string)
102
+ case strip_mode
103
+ when :strict then string
104
+ when :right_only then string.rstrip
105
+ when :right_and_internal then string.rstrip.squeeze(' ')
106
+ when :left_and_right then string.strip
107
+ when :left_right_and_internal then string.strip.squeeze(' ')
108
+ else raise "Unsupported strip mode #{@strip_mode}"
109
+ end
110
+ end
111
+
112
+ def queries
113
+ @queries ||= [query] + cookie
114
+ end
115
+
116
+ def strip_mode
117
+ @request.dig(:settings, :interactive_strip_mode) || @strip_mode
88
118
  end
89
119
  end
90
120
  end
@@ -1,3 +1,3 @@
1
1
  module Mumukit
2
- VERSION = '2.44.0'
2
+ VERSION = '2.45.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.44.0
4
+ version: 2.45.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-04-13 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler