moto 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config.rb +7 -5
- data/lib/parser.rb +8 -6
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be0991718ac695d0b5b90b955f896fe52472b982
|
4
|
+
data.tar.gz: 5a979cb0d173620014ee1c765bd1613c42d0c227
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 219808323dfc15c7046c2f29759907df267345b4839aeaaebd9f3f4c5397c199e20a49c37420a3b5de4ba0eaa6cc06219d9723bde4d9da8b857e6d45902d306f
|
7
|
+
data.tar.gz: 97ceabe6d63dc2c1275e295fbae4a8bc4aeb567d0cdda684655e686f6ee71e7c97696365657bfea8f805a21da96a8d555c6324717a087475d7d8d34aee22f18e
|
data/lib/config.rb
CHANGED
@@ -16,9 +16,12 @@ module Moto
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Loads configuration for whole test run and files responsible for environmental constants.
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
# @param [String] config_name Name of the main Moto/MotoApp config to be loaded. Without extension.
|
20
|
+
def self.load_configuration(config_name)
|
21
|
+
config_path = "#{MotoApp::DIR}/config/#{config_name}.rb"
|
22
|
+
|
23
|
+
if File.exists?(config_path)
|
24
|
+
@@moto = eval(File.read(config_path))
|
22
25
|
|
23
26
|
# Try reading constants that are common for all environments
|
24
27
|
begin
|
@@ -35,9 +38,8 @@ module Moto
|
|
35
38
|
end
|
36
39
|
|
37
40
|
@@env_consts = common_constants.deep_merge(environment_constants)
|
38
|
-
|
39
41
|
else
|
40
|
-
raise "Config file
|
42
|
+
raise "Config file: #{config_path} does not exist.\nDoes current working directory contain Moto application?"
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
data/lib/parser.rb
CHANGED
@@ -43,19 +43,19 @@ module Moto
|
|
43
43
|
opts.on('-l', '--listeners Listeners', Array) { |v| options[:listeners] = v }
|
44
44
|
opts.on('-e', '--environment Environment') { |v| options[:environment] = v }
|
45
45
|
opts.on('-n', '--name Name') { |v| options[:name] = v }
|
46
|
-
|
46
|
+
opts.on('-c', '--config Config') { |v| options[:config_name] = v}
|
47
47
|
end.parse!
|
48
48
|
|
49
49
|
if options[:name].empty?
|
50
50
|
options[:name] = evaluate_name(options[:tags], options[:tests])
|
51
51
|
end
|
52
52
|
|
53
|
-
if
|
53
|
+
if options[:environment]
|
54
|
+
Moto::Lib::Config.environment = options[:environment]
|
55
|
+
Moto::Lib::Config.load_configuration(options[:config_name] ? options[:config_name] : 'moto')
|
56
|
+
else
|
54
57
|
puts 'ERROR: Environment is mandatory.'
|
55
58
|
exit 1
|
56
|
-
else
|
57
|
-
Moto::Lib::Config.environment = options[:environment]
|
58
|
-
Moto::Lib::Config.load_configuration
|
59
59
|
end
|
60
60
|
|
61
61
|
|
@@ -105,6 +105,8 @@ module Moto
|
|
105
105
|
-l, --listeners = Reporters to be used.
|
106
106
|
Defaults are Moto::Listeners::ConsoleDots, Moto::Listeners::JunitXml
|
107
107
|
-e, --environment Mandatory environment. Environment constants and tests parametrized in certain way depend on this.
|
108
|
+
-c, --config Name of the config, without extension, to be loaded from MotoApp/config/CONFIG_NAME.rb
|
109
|
+
Default: moto (which loads: MotoApp/config/moto.rb)
|
108
110
|
|
109
111
|
|
110
112
|
moto generate:
|
@@ -114,7 +116,7 @@ module Moto
|
|
114
116
|
-tdir/test_name will create MotoApp/tests/dir/test_name/test_name.rb
|
115
117
|
-a, --appname = Name of the application. Will be also used as topmost module in test file.
|
116
118
|
Default: MotoApp
|
117
|
-
-b, --baseclass = File
|
119
|
+
-b, --baseclass = File, without extension, with base class from which test will derive. Assumes one class per file.
|
118
120
|
Examples:
|
119
121
|
-btest_base will use the file in MotoApp/lib/test/test_base.rb
|
120
122
|
-bsubdir/test_base will use the file in MotoApp/lib/test/subdir/test_base.rb
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bartek Wilczek
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|