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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c72891d116e48d0ff3999c21d91c6522ac0b1bc
4
- data.tar.gz: 9dcb05b25cc17e74dc7e52007bf68b4cae2f61a9
3
+ metadata.gz: be0991718ac695d0b5b90b955f896fe52472b982
4
+ data.tar.gz: 5a979cb0d173620014ee1c765bd1613c42d0c227
5
5
  SHA512:
6
- metadata.gz: 18653e61b99561362a55b000258b37e0b63c1e429dfd368662dcef12497366be63580488a33e9370b6ce8852a63160741fcaaadbd4616ddc697223db7eae577f
7
- data.tar.gz: 36412b9a3a27c4e76546937aa0d21916370774ef283cb9d7617601e48b857b6e54c4f0bf332b48dee796f036fba061f72c1d9798061a1abde9aeebf08fd7e04d
6
+ metadata.gz: 219808323dfc15c7046c2f29759907df267345b4839aeaaebd9f3f4c5397c199e20a49c37420a3b5de4ba0eaa6cc06219d9723bde4d9da8b857e6d45902d306f
7
+ data.tar.gz: 97ceabe6d63dc2c1275e295fbae4a8bc4aeb567d0cdda684655e686f6ee71e7c97696365657bfea8f805a21da96a8d555c6324717a087475d7d8d34aee22f18e
@@ -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
- def self.load_configuration
20
- if File.exists? "#{MotoApp::DIR}/config/moto.rb"
21
- @@moto = eval(File.read("#{MotoApp::DIR}/config/moto.rb"))
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 (config/moto.rb) not present.\nDoes current working directory contain Moto application?"
42
+ raise "Config file: #{config_path} does not exist.\nDoes current working directory contain Moto application?"
41
43
  end
42
44
  end
43
45
 
@@ -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
- # opts.on('-f', '--config Config') { |v| options[:config].deep_merge!( eval( File.read(v) ) ) }
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 !options[:environment]
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 (WITHOUT EXTENSION) with base class from which test will derive. Assumes one class per 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
@@ -1,3 +1,3 @@
1
1
  module Moto
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
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.1
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-05-31 00:00:00.000000000 Z
14
+ date: 2016-06-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport