Skip to content

Backport pull requests #1303, #1305, #1310, #1318 #1319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# This file contains defaults for RSpec projects. Individual projects
Expand Down
9 changes: 9 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Development

Bug Fixes:

* Add missing `require` to RSpec generator root fixing an issue where Rail's
autoload does not find it in some environments. (Aaron Kromer, #1305)
* `be_routable` matcher now has the correct description. (Tony Ta, #1310)
* Fix dependency to allow Rails 4.2.x patches / pre-releases (Lucas Mazza, #1318)

### 3.2.0 / 2015-02-03
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.1.0...v3.2.0)

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

version: "{build}"
Expand Down
1 change: 1 addition & 0 deletions lib/generators/rspec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rails/generators/named_base'
require 'rspec/rails/feature_check'

# Weirdly named generators namespace (should be `RSpec`) for compatability with
# rails loading.
Expand Down
4 changes: 4 additions & 0 deletions lib/rspec/rails/matchers/routing_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def failure_message
def failure_message_when_negated
"expected #{@actual.inspect} not to be routable, but it routes to #{@routing_options.inspect}"
end

def description
"be routable"
end
end

# Passes if the route expression is recognized by the Rails router based on
Expand Down
6 changes: 3 additions & 3 deletions rspec-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Gem::Specification.new do |s|
s.cert_chain = [File.expand_path('~/.gem/rspec-gem-public_cert.pem')]
end

s.add_runtime_dependency(%q<activesupport>, [">= 3.0", "<= 4.2"])
s.add_runtime_dependency(%q<actionpack>, [">= 3.0", "<= 4.2"])
s.add_runtime_dependency(%q<railties>, [">= 3.0", "<= 4.2"])
s.add_runtime_dependency(%q<activesupport>, [">= 3.0", "< 4.3"])
s.add_runtime_dependency(%q<actionpack>, [">= 3.0", "< 4.3"])
s.add_runtime_dependency(%q<railties>, [">= 3.0", "< 4.3"])
%w[core expectations mocks support].each do |name|
if RSpec::Rails::Version::STRING =~ /[a-zA-Z]+/ # prerelease builds
s.add_runtime_dependency "rspec-#{name}", "= #{RSpec::Rails::Version::STRING}"
Expand Down
27 changes: 14 additions & 13 deletions script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#!/bin/bash
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
source script/functions.sh

pushd ..

clone_repo "rspec"
clone_repo "rspec-core"
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"

if is_mri; then
pushd ..

clone_repo "rspec"
clone_repo "rspec-core"
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"
clone_repo "rspec-rails"
fi

if rspec_support_compatible; then
clone_repo "rspec-support"
fi
if rspec_support_compatible; then
clone_repo "rspec-support"
fi

popd
popd
else
echo "Not cloning all repos since we are not on MRI and they are only needed for the MRI build"
fi
26 changes: 9 additions & 17 deletions script/functions.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/travis_functions.sh
source $SCRIPT_DIR/predicate_functions.sh

# idea taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
export JRUBY_OPTS="${JRUBY_OPTS} -X-C" # disable JIT since these processes are so short lived
# If JRUBY_OPTS isn't set, use these.
# see http://docs.travis-ci.com/user/ci-environment/
export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
SPECS_HAVE_RUN_FILE=specs.out
MAINTENANCE_BRANCH=`cat maintenance-branch`

Expand Down Expand Up @@ -58,13 +59,9 @@ function run_cukes {
function run_specs_one_by_one {
echo "Running each spec file, one-by-one..."

if is_mri; then
for file in `find spec -iname '*_spec.rb'`; do
bin/rspec $file -b --format progress
done
else
echo "Skipping one-by-one specs on non-MRI rubies as they tend to have long boot times"
fi
for file in `find spec -iname '*_spec.rb'`; do
bin/rspec $file -b --format progress
done
}

function run_spec_suite_for {
Expand All @@ -73,7 +70,7 @@ function run_spec_suite_for {
pushd ../$1
unset BUNDLE_GEMFILE
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
travis_retry eval "time bundle install $bundle_install_flags"
travis_retry eval "bundle install $bundle_install_flags"
run_specs_and_record_done
popd
fi;
Expand Down Expand Up @@ -125,12 +122,7 @@ function run_all_spec_suites {
fold "rspec-core specs" run_spec_suite_for "rspec-core"
fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations"
fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks"

if is_mri; then
fold "rspec-rails specs" run_spec_suite_for "rspec-rails"
else
echo "Skipping rspec-rails specs on non-MRI rubies"
fi
fold "rspec-rails specs" run_spec_suite_for "rspec-rails"

if rspec_support_compatible; then
fold "rspec-support specs" run_spec_suite_for "rspec-support"
Expand Down
14 changes: 1 addition & 13 deletions script/predicate_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

function is_mri {
Expand All @@ -11,18 +11,6 @@ function is_mri {
fi;
}

function is_jruby_20_mode {
if [ -z "$JRUBY_OPTS" ]; then
if ruby -e "exit(RUBY_VERSION == '2.0.0')"; then
return 0
else
return 1
fi
else
return 1
fi
}

function is_mri_192 {
if is_mri; then
if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then
Expand Down
8 changes: 4 additions & 4 deletions script/run_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
Expand All @@ -21,8 +21,8 @@ if style_and_lint_enforced; then
fold "rubocop" check_style_and_lint
fi

if is_jruby_20_mode; then
echo "Skipping other specs suites on JRuby 2.0 mode because it is so much slower"
else
if is_mri; then
run_all_spec_suites
else
echo "Skipping the rest of the build on non-MRI rubies"
fi
2 changes: 1 addition & 1 deletion script/travis_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2015-01-08T19:12:50-08:00 from the rspec-dev repo.
# This file was generated on 2015-02-08T20:55:32-08:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# Taken from:
Expand Down
4 changes: 4 additions & 0 deletions spec/rspec/rails/matchers/be_routable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

before { @routes = double("routes") }

it "provides a description" do
expect(be_routable.description).to eq("be routable")
end

context "with should" do
it "passes if routes recognize the path" do
allow(routes).to receive(:recognize_path) { {} }
Expand Down