Permalink
Browse files

Require 'spec_helper' and remove all usage of deprecated RAILS_ROOT/ENV

  • Loading branch information...
1 parent b1bc756 commit 8c7518797176f9759081fb2bae6e48147d19ed28 @jcf jcf committed Feb 16, 2010
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe <%= class_name %>Controller do
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe <%= class_name %>Helper do
@@ -3,7 +3,7 @@ if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].in
require 'rubygems' unless ENV['NO_RUBYGEMS']
else
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
- ENV["RAILS_ENV"] ||= 'test'
+ ENV["Rails.env"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(Rails.root)
end
require 'spec/autorun'
@@ -2,7 +2,7 @@
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
puts "Loading Rails environment"
-ENV["RAILS_ENV"] ||= 'test'
+ENV["Rails.env"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(Rails.root)
require 'optparse'
@@ -1,7 +1,7 @@
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
-ENV["RAILS_ENV"] ||= 'test'
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
+ENV["Rails.env"] ||= 'test'
+require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'spec/autorun'
require 'spec/rails'
@@ -15,7 +15,7 @@
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
- config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ config.fixture_path = Rails.root + '/spec/fixtures/'
# == Fixtures
#
@@ -34,7 +34,7 @@
#
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
#
- # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ # config.fixture_path = Rails.root + '/spec/fixtures/'
#
# == Mock Framework
#
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe "<%= class_name.pluralize %>" do
end
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe <%= class_name %> do
<% for action in actions -%>
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe <%= class_name %> do
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe <%= controller_class_name %>Controller do
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
+require 'spec_helper'
describe <%= controller_class_name %>Controller do
describe "route generation" do
View
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jose Valim", "Anuj Dutta", "Paul Berry", "Jeff Tucker", "Louis T.", "Jai-Gouk Kim"]
- s.date = %q{2010-01-30}
+ s.date = %q{2010-02-16}
s.description = %q{Rails 3 compatible generators for DataMapper, Haml, Factory-girl, Authlogic, and Mongomapper}
s.email = %q{andre@arko.net}
s.extra_rdoc_files = [
@@ -48,6 +48,40 @@ Gem::Specification.new do |s|
"lib/generators/mongomapper/model/model_generator.rb",
"lib/generators/mongomapper/model/templates/model.rb",
"lib/generators/mongomapper/observer/observer_generator.rb",
+ "lib/generators/rspec.rb",
+ "lib/generators/rspec/controller/controller_generator.rb",
+ "lib/generators/rspec/controller/templates/controller_spec.rb",
+ "lib/generators/rspec/controller/templates/view_spec.rb",
+ "lib/generators/rspec/helper/helper_generator.rb",
+ "lib/generators/rspec/helper/templates/helper_spec.rb",
+ "lib/generators/rspec/install/install_generator.rb",
+ "lib/generators/rspec/install/templates/lib/tasks/rspec.rake",
+ "lib/generators/rspec/install/templates/script/autospec.tt",
+ "lib/generators/rspec/install/templates/script/spec.tt",
+ "lib/generators/rspec/install/templates/script/spec_server.tt",
+ "lib/generators/rspec/install/templates/spec/rcov.opts",
+ "lib/generators/rspec/install/templates/spec/spec.opts",
+ "lib/generators/rspec/install/templates/spec/spec_helper.rb",
+ "lib/generators/rspec/integration/integration_generator.rb",
+ "lib/generators/rspec/integration/templates/integration_spec.rb",
+ "lib/generators/rspec/mailer/mailer_generator.rb",
+ "lib/generators/rspec/mailer/templates/fixture",
+ "lib/generators/rspec/mailer/templates/mailer_spec.rb",
+ "lib/generators/rspec/model/model_generator.rb",
+ "lib/generators/rspec/model/templates/fixtures.yml",
+ "lib/generators/rspec/model/templates/model_spec.rb",
+ "lib/generators/rspec/observer/observer_generator.rb",
+ "lib/generators/rspec/observer/templates/observer_spec.rb",
+ "lib/generators/rspec/plugin/plugin_generator.rb",
+ "lib/generators/rspec/plugin/templates/%file_name%_spec.rb.tt",
+ "lib/generators/rspec/plugin/templates/test_helper.rb",
+ "lib/generators/rspec/scaffold/scaffold_generator.rb",
+ "lib/generators/rspec/scaffold/templates/controller_spec.rb",
+ "lib/generators/rspec/scaffold/templates/edit_spec.rb",
+ "lib/generators/rspec/scaffold/templates/index_spec.rb",
+ "lib/generators/rspec/scaffold/templates/new_spec.rb",
+ "lib/generators/rspec/scaffold/templates/routing_spec.rb",
+ "lib/generators/rspec/scaffold/templates/show_spec.rb",
"lib/rails3-generators.rb",
"rails3-generators.gemspec"
]

0 comments on commit 8c75187

Please sign in to comment.