moto 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19ae32e48ee7e8f28a830bd6ecfb283f85ab9937
4
- data.tar.gz: 0b589d53644a0b9320764703babfe95f27361838
3
+ metadata.gz: ae9e65a6ed5be9e5dcab4f274fb56543e43ce7a8
4
+ data.tar.gz: 5bcddba5dd2dd8b16e5108219488579eea8827df
5
5
  SHA512:
6
- metadata.gz: 722e6c766343c53cf0d5a83e50997866abab73ecb0f9cb28bc76a7e7223d03406b6979fa5ef2337623b128fc60c3566f7b5dc81a8a82ec161046a149eb78b363
7
- data.tar.gz: 914aa51a2cf6945a500bde9dde1b1d3762a5dfc03fc0b3bc5f81855c48135320510af7b44fbfcd742f295f4dca4b0ffadb71cff59862d0b96dfc08b60ff46952
6
+ metadata.gz: 8b7a58130b054529d9de03e161077931c772beefd3e8c6ae803dab00507ffd9e2caaf6c8dc79f7f106b05fb1115e5ef8de581f8bf72452c6935b91561d76b8e2
7
+ data.tar.gz: aebd387ed9021158a73b7daa28badaeaea4416a246e0c68b77cf5b5d9032f1e49583cb824b39604d254d83698f5feee584bd642fe48c9defe395276551a37e5b
data/lib/cli.rb CHANGED
@@ -70,6 +70,14 @@ module Moto
70
70
  exit 1
71
71
  end
72
72
 
73
+ # Requires custom initializer if provided by application that uses Moto
74
+ if File.exists?( "#{MotoApp::DIR}/lib/initializer.rb" )
75
+ require("#{Moto::DIR}/lib/initializer.rb")
76
+ require("#{MotoApp::DIR}/lib/initializer.rb")
77
+ initializer = MotoApp::Initializer.new(self)
78
+ initializer.init
79
+ end
80
+
73
81
  tg = TestGenerator.new(MotoApp::DIR)
74
82
  test_paths_absolute.each do |test_path|
75
83
  test_classes << tg.generate(test_path)
@@ -80,10 +88,10 @@ module Moto
80
88
  listener = 'Moto::Listeners::' + r.camelize
81
89
  listeners << listener.constantize
82
90
  end
83
-
91
+
84
92
  runner = Moto::Runner.new(test_classes, listeners, argv[:environments], argv[:config], argv[:name])
85
93
  runner.run
86
94
  end
87
-
95
+
88
96
  end
89
97
  end
data/lib/runner.rb CHANGED
@@ -56,12 +56,6 @@ module Moto
56
56
  end
57
57
 
58
58
  def run
59
- if File.exists?( "#{MotoApp::DIR}/lib/initializer.rb" )
60
- require("#{Moto::DIR}/lib/initializer.rb")
61
- require("#{MotoApp::DIR}/lib/initializer.rb")
62
- initializer = MotoApp::Initializer.new(self)
63
- initializer.init
64
- end
65
59
  @listeners.each { |l| l.start_run }
66
60
  @tests.each do |test|
67
61
  @thread_pool.schedule do
@@ -46,16 +46,17 @@ module Moto
46
46
  generate_for_run_body(test_path_absolute, method_body)
47
47
  end
48
48
  end
49
-
49
+
50
+ # Generates objects with tests that are supposed to be executed in this run.
50
51
  def generate_for_full_class_code(test_path_absolute)
51
52
  require test_path_absolute
52
- class_name = test_path_absolute.gsub("#{MotoApp::DIR}/",'moto_app/').split('/')[0..-2].join('/').camelize
53
- test_object = class_name.constantize.new
53
+ class_name = test_path_absolute.gsub("#{MotoApp::DIR}/",'moto_app/').camelize.chomp('.rb').constantize
54
+ test_object = class_name.new
54
55
  test_object.static_path = test_path_absolute
55
56
  test_object.evaled = false
56
- test_object
57
+ test_object
57
58
  end
58
-
59
+
59
60
  def generate_for_run_body(test_path_absolute, method_body)
60
61
  base = Moto::Test
61
62
  base_class_string = method_body.match( /^#\s*BASE_CLASS:\s(\S+)/ )
@@ -14,6 +14,9 @@ module Moto
14
14
  @test = test
15
15
  @clients = {}
16
16
  @test.context = self
17
+ #TODO temporary fix
18
+ Thread.current['context']= self
19
+
17
20
  @config = {}
18
21
  Dir.glob("config/*.yml").each do |f|
19
22
  @config.deep_merge! YAML.load_file(f)
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Moto
2
- VERSION = '0.0.23'
2
+ VERSION = '0.0.24'
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.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartek Wilczek
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-02 00:00:00.000000000 Z
13
+ date: 2016-02-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport