rspec_for_generators 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
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
- Rails.application.configure do
32
- # use default rails tmp dir
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
- # configure it!
40
- RSpec::Generator.configure!
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.0
1
+ 0.3.1
@@ -31,7 +31,11 @@ module RSpec
31
31
  FileUtils.rm_rf ::TmpRails.root
32
32
  end
33
33
 
34
- def configure!
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
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rspec_for_generators}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -35,7 +35,6 @@ describe 'model_generator' do
35
35
  end
36
36
  end
37
37
  end
38
-
39
38
  end
40
39
 
41
40
 
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
- Rails.application.configure do
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
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup