rspec_for_generators 0.3.0 → 0.3.1
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.
data/README.markdown
CHANGED
@@ -28,16 +28,11 @@ First setup the *spec_helper.rb*. Here is an example configuration.
|
|
28
28
|
require 'rspec'
|
29
29
|
require 'rspec_for_generators'
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
config.root_dir = TmpRails.root_dir(__FILE__)
|
34
|
-
|
35
|
-
# or specify custom rails tmp dir
|
36
|
-
# config.root_dir = TmpRails.root_dir(File.dirname(__FILE__) + '/../tmp', :custom)
|
37
|
-
end
|
31
|
+
# configure it like this to use default settings
|
32
|
+
RSpec::Generator.configure_root_dir __FILE__
|
38
33
|
|
39
|
-
#
|
40
|
-
RSpec::Generator.
|
34
|
+
# or customize the location of the temporary Rails 3 app dir used
|
35
|
+
RSpec::Generator.configure_root_dir '~/my/rails/folder', :custom
|
41
36
|
</pre>
|
42
37
|
|
43
38
|
### Specs for generators
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
@@ -31,7 +31,11 @@ module RSpec
|
|
31
31
|
FileUtils.rm_rf ::TmpRails.root
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
34
|
+
def configure_root_dir path, options = {}
|
35
|
+
::Rails.application.configure do
|
36
|
+
config.root_dir = options == :custom ? TmpRails.root_dir(File.dirname(path) + '/../tmp', :custom) : TmpRails.root_dir(path)
|
37
|
+
end
|
38
|
+
|
35
39
|
::RSpec::Generators::TestCase.destination ::Rails.root
|
36
40
|
::Rails::Generators.configure!
|
37
41
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,5 @@ require 'rspec'
|
|
2
2
|
require 'rspec/autorun'
|
3
3
|
require 'rspec_for_generators'
|
4
4
|
|
5
|
-
|
6
|
-
# config.root_dir = TmpRails.root_dir(__FILE__)
|
7
|
-
config.root_dir = TmpRails.root_dir(File.dirname(__FILE__) + '/../tmp', :custom)
|
8
|
-
end
|
9
|
-
|
10
|
-
RSpec::Generator.configure!
|
5
|
+
RSpec::Generator.configure_root_dir __FILE__
|
11
6
|
|