mumuki-sqlite-runner 3.0.0 → 3.1.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: 2ff96b8daaf98e39b42e29a2e4a0fda7447ede4b33db3a496bbe09d76b021456
4
- data.tar.gz: 124dd0f35e776db7a7ffde818afdb6e3cd4779d8f1c248d0e61e3391dfd5dc08
3
+ metadata.gz: e971b83ccdad28673f28cfa2ee6c40721ef5584e25d6d15e5ced8bd961e0f766
4
+ data.tar.gz: 7987a0938706989f590071825bb83842384a3e3d4b61f9a55b3f865f42d98cc5
5
5
  SHA512:
6
- metadata.gz: a503486ccbe2dddbbdfdf0274d50574585fa95b1b578e609c874578c1f8369aeaea33acbb58e4ee537c2ba0af2ccb3a3f42935e7a6e2e668dab3eb5ba340c186
7
- data.tar.gz: 3c2e5a3d94069b7122dbe584ce81c8e76c2cf0ac6866c3987687f8995fc5e0f7671740c923632ad7e8d2a71cc141dafe406c5a2ee1aca062c95b3ccaf642ff6a
6
+ metadata.gz: fed2e43fcb1f7f3ed534f4bb26f7e1f512b0ce70ed6ce4d972677fa0cd136418322ec4a189a5e4534ec4191aada64cb549b8ea43b5b3a542582c890fc1047226
7
+ data.tar.gz: e0c229624b5cf5b524fba4ae1db2b8320459982d346a2f9bf0cec3cf4e51a2c72e50cf13d2e6bf62478b5acebbc0e9ceed4ba6fb52f83e1cb3283d9a501c8e4a
data/lib/metadata_hook.rb CHANGED
@@ -11,8 +11,45 @@ class SqliteMetadataHook < Mumukit::Hook
11
11
  },
12
12
  test_framework: {
13
13
  name: 'metatest',
14
- test_extension: 'yml'
14
+ test_extension: 'yml',
15
+ template: template
15
16
  }
16
17
  }
17
18
  end
19
+
20
+ def template
21
+ <<YAML
22
+ # El siguiente es un ejemplo de cómo generar test para SQL utilizando formato YAML.
23
+ # Acá dejamos los tres tipos de tests que podés escribir.
24
+ # Para info más detallada revisá la wiki: https://github.com/mumuki/mumuki-sqlite-runner/wiki
25
+
26
+ # 1. query
27
+ - type: query
28
+ seed: | # Opcional
29
+ INSERT INTO table VALUES ('dato 1');
30
+ INSERT INTO table VALUES ('dato 2');
31
+ expected: SELECT * FROM table;
32
+ # 2. datasets
33
+ - type: datasets
34
+ seed: | # Opcional
35
+ INSERT INTO table VALUES ('dato 1');
36
+ INSERT INTO table VALUES ('dato 2');
37
+ expected: |
38
+ id|descrip
39
+ 1|dato 1
40
+ 2|dato 2
41
+ # 3. final_dataset
42
+ - type: final_dataset
43
+ seed: | # Opcional
44
+ INSERT INTO table VALUES ('dato 1');
45
+ INSERT INTO table VALUES ('dato 2');
46
+ final: SELECT descrip FROM bolitas;
47
+ # Supongamos que el ejercicio pide insertar 'dato 3'
48
+ expected: |
49
+ descrip
50
+ dato 1
51
+ dato 2
52
+ dato 3
53
+ YAML
54
+ end
18
55
  end
data/lib/sqlite_runner.rb CHANGED
@@ -5,7 +5,7 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
5
5
 
6
6
  Mumukit.runner_name = 'sqlite'
7
7
  Mumukit.configure do |config|
8
- config.docker_image = 'mumuki/mumuki-sqlite-worker:v3-rc1'
8
+ config.docker_image = 'mumuki/mumuki-sqlite-worker:3'
9
9
  config.content_type = 'html'
10
10
  config.structured = true
11
11
  end
data/lib/test_hook.rb CHANGED
@@ -134,6 +134,7 @@ class SqliteTestHook < Mumukit::Templates::FileHook
134
134
  # ...
135
135
  def parse_tests(tests)
136
136
  tests = YAML.load tests
137
+ tests = [tests] unless tests.kind_of? Array
137
138
  @tests = tests.map do | test |
138
139
  test = test.to_struct
139
140
  @test_parsers[test.type.to_sym].new test
data/lib/version_hook.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SqliteVersionHook
2
- VERSION = '3.0.0'
2
+ VERSION = '3.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-sqlite-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Di Lorenzo
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.6'
19
+ version: '2.17'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.6'
26
+ version: '2.17'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -189,7 +189,7 @@ files:
189
189
  - lib/version_hook.rb
190
190
  - lib/view/rows_error.html.erb
191
191
  - lib/view/rows_success.html.erb
192
- homepage: http://github.com/leandrojdl/mumuki-sqlite-runner
192
+ homepage: http://github.com/mumuki/mumuki-sqlite-runner
193
193
  licenses:
194
194
  - MIT
195
195
  metadata: {}