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 +4 -4
- data/lib/metadata_hook.rb +38 -1
- data/lib/sqlite_runner.rb +1 -1
- data/lib/test_hook.rb +1 -0
- data/lib/version_hook.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e971b83ccdad28673f28cfa2ee6c40721ef5584e25d6d15e5ced8bd961e0f766
|
4
|
+
data.tar.gz: 7987a0938706989f590071825bb83842384a3e3d4b61f9a55b3f865f42d98cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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
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.
|
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.
|
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.
|
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/
|
192
|
+
homepage: http://github.com/mumuki/mumuki-sqlite-runner
|
193
193
|
licenses:
|
194
194
|
- MIT
|
195
195
|
metadata: {}
|