Skip to content

Commit b01dbd9

Browse files
committed
Merge pull request #64 from rspec/add-rspec-rails-to-builds
[WIP] Add rspec-rails spec suite to travis builds.
2 parents 0b18bee + 1cb6ca9 commit b01dbd9

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ namespace :travis do
286286

287287
each_project_with_common_travis_build do |name|
288288
unless system("git push origin #{branch}")
289-
puts "Push failed, force?"
289+
puts "Push failed, force? (y/n)"
290290
if STDIN.gets.downcase =~ /^y/
291291
sh "git push origin +#{branch}"
292292
end

travis/script/clone_all_rspec_repos

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if is_mri; then
99
clone_repo "rspec-core"
1010
clone_repo "rspec-expectations"
1111
clone_repo "rspec-mocks"
12+
clone_repo "rspec-rails"
1213

1314
if rspec_support_compatible; then
1415
clone_repo "rspec-support"

travis/script/functions.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
export JRUBY_OPTS='-X-C' # disable JIT since these processes are so short lived
33
SPECS_HAVE_RUN_FILE=specs.out
44
MAINTENANCE_BRANCH=`cat maintenance-branch`
5-
BUNDLE_INSTALL_FLAGS=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
65

76
# Taken from:
87
# https://github.com/travis-ci/travis-build/blob/e9314616e182a23e6a280199cd9070bfc7cae548/lib/travis/build/script/templates/header.sh#L34-L53
@@ -49,6 +48,12 @@ function is_mri_192 {
4948
fi
5049
}
5150

51+
function set_rails_version_for_rspec_rails {
52+
if ruby -e "exit(RUBY_VERSION < '1.9.3')"; then
53+
export RAILS_VERSION=3.2.17
54+
fi
55+
}
56+
5257
function rspec_support_compatible {
5358
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
5459
return 0
@@ -120,7 +125,8 @@ function run_spec_suite_for {
120125
echo "Running specs for $1"
121126
echo
122127
unset BUNDLE_GEMFILE
123-
travis_retry bundle install $BUNDLE_INSTALL_FLAGS
128+
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
129+
travis_retry bundle install $bundle_install_flags
124130
run_specs_and_record_done
125131
popd
126132
fi;

travis/script/run_build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if is_mri; then
1515
run_spec_suite_for "rspec-expectations"
1616
run_spec_suite_for "rspec-mocks"
1717

18+
set_rails_version_for_rspec_rails
19+
run_spec_suite_for "rspec-rails"
20+
1821
if rspec_support_compatible; then
1922
run_spec_suite_for "rspec-support"
2023
fi

0 commit comments

Comments
 (0)