aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-10-17 15:54:58 -0300
committerJosé Valim <jose.valim@gmail.com>2009-10-17 15:54:58 -0300
commit03c5a0e5c4c9888c54265d6ef97136854e0ff9e4 (patch)
tree2121d951588c2e0fe33b1af85461d8cb8f96ac91
parentcb873026898badc5c3dc61a95a08051cf218251f (diff)
downloadrails-03c5a0e5c4c9888c54265d6ef97136854e0ff9e4.tar.gz
rails-03c5a0e5c4c9888c54265d6ef97136854e0ff9e4.tar.bz2
rails-03c5a0e5c4c9888c54265d6ef97136854e0ff9e4.zip
Make app generatoor specs green once again.
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile6
-rw-r--r--railties/test/generators/app_generator_test.rb11
2 files changed, 12 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index abe8c1556c..3966c0f70d 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -1,9 +1,9 @@
# Gemfile is where you list all of your application's dependencies
#
-gem "rails", "<%= Rails::VERSION::STRING %>"
+<%= "# " if options.freeze? %>gem "rails", "<%= Rails::VERSION::STRING %>"
#
# Bundling edge rails:
-# gem "rails", "<%= Rails::VERSION::STRING %>", :git => "git://github.com/rails/rails.git"
+<%= "# " unless options.freeze? %>gem "rails", "<%= Rails::VERSION::STRING %>", :git => "git://github.com/rails/rails.git"
# Specify gemcutter as a gem source
# source "http://gemcutter.org"
@@ -18,4 +18,4 @@ gem "rails", "<%= Rails::VERSION::STRING %>"
# gem "rspec", :only => :test
# only :test do
# gem "webrat"
-# end \ No newline at end of file
+# end
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 5d6a9f6de9..20f2a24e6d 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -114,11 +114,18 @@ class AppGeneratorTest < GeneratorsTestCase
generator(:freeze => true, :database => "sqlite3").expects(:run).
with("rake rails:freeze:edge", :verbose => false)
silence(:stdout){ generator.invoke }
- assert_file 'config/environment.rb', /# RAILS_GEM_VERSION/
+
+ assert_file 'Gemfile' do |content|
+ flag = %(gem "rails", "#{Rails::VERSION::STRING}", :git => "git://github.com/rails/rails.git")
+ assert_match /^#{Regexp.escape(flag)}$/, content
+
+ flag = %(# gem "rails", "#{Rails::VERSION::STRING}")
+ assert_match /^#{Regexp.escape(flag)}$/, content
+ end
end
def test_template_from_dir_pwd
- FileUtils.cd(RAILS_ROOT)
+ FileUtils.cd(Rails.root)
assert_match /It works from file!/, run_generator(["-m", "lib/template.rb"])
end