Skip to content

Commit 05a1d7f

Browse files
author
Sam Phippen
committed
Merge pull request #1502 from deivid-rodriguez/development_improvements
Development improvements
2 parents d3d7e79 + 0de0419 commit 05a1d7f

File tree

5 files changed

+20
-26
lines changed

5 files changed

+20
-26
lines changed

Gemfile-rails-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ when nil, false, ""
1919
# Rails 4+ requires 1.9.3+, so on earlier versions default to the last 3.x release.
2020
gem "rails", "~> 3.2.17"
2121
else
22-
gem "rails", "~> 4.0.4"
22+
gem "rails", "~> 4.2.0"
2323
end
2424
else
2525
gem "rails", version

Rakefile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ end
120120
namespace :no_active_record do
121121
example_app_dir = './tmp/no_ar_example_app'
122122

123-
desc "run a vairety of specs against a non-ActiveRecord generated app"
123+
desc "run a variety of specs against a non-ActiveRecord generated app"
124124
task :smoke do
125125
in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rake rails:template --backtrace",
126126
:app_dir => example_app_dir
@@ -151,21 +151,19 @@ namespace :no_active_record do
151151
sh "rm -f #{bindir}/rails"
152152
sh "bundle exec rails new #{example_app_dir} --skip-active-record --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=example_app_generator/generate_app.rb"
153153

154-
if test 'd', bindir
155-
in_example_app(:app_dir => example_app_dir) do
156-
sh "bundle install --gemfile ./Gemfile --path ../../../bundle"
157-
# Rails 4 cannot use a `rails` binstub generated by Bundler
158-
sh "bundle binstubs rspec-core rake --force"
159-
sh "bundle binstubs railties" unless File.exist?("bin/rails")
160-
161-
application_file = File.read("config/application.rb")
162-
sh "rm config/application.rb"
163-
File.open("config/application.rb","w") do |f|
164-
f.write application_file.gsub(
165-
"config.assets.enabled = true",
166-
"config.assets.enabled = false"
167-
)
168-
end
154+
in_example_app(:app_dir => example_app_dir) do
155+
sh "./travis_retry_bundle_install.sh 2>&1"
156+
# Rails 4 cannot use a `rails` binstub generated by Bundler
157+
sh "bundle binstubs rspec-core rake --force"
158+
sh "bundle binstubs railties" unless File.exist?("bin/rails")
159+
160+
application_file = File.read("config/application.rb")
161+
sh "rm config/application.rb"
162+
File.open("config/application.rb","w") do |f|
163+
f.write application_file.gsub(
164+
"config.assets.enabled = true",
165+
"config.assets.enabled = false"
166+
)
169167
end
170168
end
171169
end

rspec-rails.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
1414
s.description = "rspec-rails is a testing framework for Rails 3.x and 4.x."
1515

1616
s.files = `git ls-files -- lib/*`.split("\n")
17-
s.files += %w[README.md License.md Changelog.md Capybara.md .yardopts .document]
17+
s.files += %w[README.md LICENSE.md Changelog.md Capybara.md .yardopts .document]
1818
s.test_files = []
1919
s.rdoc_options = ["--charset=UTF-8"]
2020
s.require_path = "lib"
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
3636
end
3737
end
3838

39-
s.add_development_dependency 'rake', '~> 10.0.0'
39+
s.add_development_dependency 'rake', '~> 10.0'
4040
s.add_development_dependency 'cucumber', '~> 1.3.5'
4141
s.add_development_dependency 'aruba', '~> 0.5.4'
4242
s.add_development_dependency 'ammeter', '1.1.2'

spec/generators/rspec/install/install_generator_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def require_rspec_rails
2727
match(/^require 'rspec\/rails'$/m)
2828
end
2929

30-
def use_transactional_fixtures
30+
def have_transactional_fixtures_enabled?
3131
match(/config\.use_transactional_fixtures/m)
3232
end
3333

@@ -70,7 +70,7 @@ def filter_rails_from_backtrace
7070

7171
specify "with default fixture path" do
7272
run_generator
73-
expect(rails_helper).to use_transactional_fixtures
73+
expect(rails_helper).to have_transactional_fixtures_enabled?
7474
end
7575

7676
specify "excluding rails gems from the backtrace" do
@@ -114,7 +114,7 @@ def filter_rails_from_backtrace
114114

115115
it "does not include config.use_transactional_fixtures" do
116116
run_generator
117-
expect(rails_helper).not_to use_transactional_fixtures
117+
expect(rails_helper).not_to have_transactional_fixtures_enabled?
118118
end
119119

120120
it "does not check use active record migration options" do

spec/spec_helper.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
require 'rails/all'
22

3-
class << RSpec
4-
attr_writer :configuration
5-
end
6-
73
module RSpecRails
84
class Application < ::Rails::Application
95
self.config.secret_key_base = 'ASecretString' if config.respond_to? :secret_key_base

0 commit comments

Comments
 (0)