imedo-dry_plugin_test_helper 0.0.5 → 0.0.6
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.
@@ -6,6 +6,14 @@ class PluginTestEnvironment
|
|
6
6
|
#
|
7
7
|
#
|
8
8
|
def self.initialize_environment(plugin_dir, options = {:use_standard_migration => true})
|
9
|
+
if plugin_dir.nil?
|
10
|
+
plugin_dir ||= find_plugin_dir_by_caller
|
11
|
+
else
|
12
|
+
if plugin_dir.is_a?(Hash)
|
13
|
+
options = plugin_dir
|
14
|
+
plugin_dir = find_plugin_dir_by_caller
|
15
|
+
end
|
16
|
+
end
|
9
17
|
self.plugin_path = File.join(plugin_dir, '..')
|
10
18
|
require File.dirname(__FILE__) + '/../rails_root/config/boot.rb'
|
11
19
|
|
@@ -139,6 +147,11 @@ class PluginTestEnvironment
|
|
139
147
|
Migration.up
|
140
148
|
end
|
141
149
|
end
|
150
|
+
|
151
|
+
def self.find_plugin_dir_by_caller
|
152
|
+
# 1 = two levels up => Where the env is initialized
|
153
|
+
File.dirname(caller[1].split(":").first)
|
154
|
+
end
|
142
155
|
|
143
156
|
class Migration < ActiveRecord::Migration
|
144
157
|
def self.setup(&block)
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imedo-dry_plugin_test_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hendrik Volkmer
|
@@ -9,11 +9,12 @@ autorequire: active_record
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-04-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
@@ -23,6 +24,7 @@ dependencies:
|
|
23
24
|
version:
|
24
25
|
- !ruby/object:Gem::Dependency
|
25
26
|
name: sqlite3-ruby
|
27
|
+
type: :runtime
|
26
28
|
version_requirement:
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
28
30
|
requirements:
|
@@ -59,6 +61,7 @@ files:
|
|
59
61
|
- rails_root/config/environments/postgresql.rb
|
60
62
|
- rails_root/config/environments/sqlite.rb
|
61
63
|
- rails_root/config/environments/sqlite3.rb
|
64
|
+
- rails_root/config/environments/test.rb
|
62
65
|
- rails_root/config/routes.rb
|
63
66
|
- rails_root/db
|
64
67
|
- rails_root/db/migrate
|