Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 61d2acd

Browse files
committed
EXPERIMENTAL: Prototype rspec-dev changes
1 parent f017880 commit 61d2acd

File tree

3 files changed

+16
-86
lines changed

3 files changed

+16
-86
lines changed

script/clone_all_rspec_repos

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ if is_mri; then
1313
clone_repo "rspec-expectations"
1414
clone_repo "rspec-mocks"
1515
clone_repo "rspec-rails"
16-
17-
if rspec_support_compatible; then
18-
clone_repo "rspec-support"
19-
fi
16+
clone_repo "rspec-support"
2017

2118
popd
2219
else

script/functions.sh

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ SPECS_HAVE_RUN_FILE=specs.out
1212
MAINTENANCE_BRANCH=`cat maintenance-branch`
1313

1414
# Don't allow rubygems to pollute what's loaded. Also, things boot faster
15-
# without the extra load time of rubygems. Only works on MRI Ruby 1.9+
16-
if is_mri_192_plus; then
17-
export RUBYOPT="--disable=gem"
18-
fi
15+
# without the extra load time of rubygems.
16+
export RUBYOPT="--disable=gem"
1917

2018
function clone_repo {
2119
if [ ! -d $1 ]; then # don't clone if the dir is already there
@@ -38,21 +36,16 @@ function run_specs_and_record_done {
3836

3937
function run_cukes {
4038
if [ -d features ]; then
41-
# force jRuby to use client mode JVM or a compilation mode thats as close as possible,
42-
# idea taken from https://github.com/jruby/jruby/wiki/Improving-startup-time
43-
#
44-
# Note that we delay setting this until we run the cukes because we've seen
45-
# spec failures in our spec suite due to problems with this mode.
46-
export JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1'
47-
4839
echo "${PWD}/bin/cucumber"
4940

50-
if is_mri_192; then
51-
# For some reason we get SystemStackError on 1.9.2 when using
52-
# the bin/cucumber approach below. That approach is faster
53-
# (as it avoids the bundler tax), so we use it on rubies where we can.
54-
bundle exec cucumber --strict
55-
elif is_jruby; then
41+
if is_jruby; then
42+
# Force JRuby to use client mode JVM or a compilation mode thats as close as possible,
43+
# idea taken from https://github.com/jruby/jruby/wiki/Improving-startup-time
44+
#
45+
# Note that we delay setting this until we run the cukes because we've seen
46+
# spec failures in our spec suite due to problems with this mode.
47+
export JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1'
48+
5649
# For some reason JRuby doesn't like our improved bundler setup
5750
RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \
5851
PATH="${PWD}/bin:$PATH" \
@@ -191,7 +184,5 @@ function run_all_spec_suites {
191184
fold "rspec-rails specs" run_spec_suite_for "rspec-rails"
192185
fi
193186

194-
if rspec_support_compatible; then
195-
fold "rspec-support specs" run_spec_suite_for "rspec-support"
196-
fi
187+
fold "rspec-support specs" run_spec_suite_for "rspec-support"
197188
}

script/predicate_functions.sh

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,23 @@
22
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
33

44
function is_mri {
5-
if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then
6-
# RUBY_ENGINE only returns 'ruby' on MRI.
7-
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
5+
# RUBY_ENGINE only returns 'ruby' on MRI.
6+
if ruby -e "exit(RUBY_ENGINE == 'ruby')"; then
87
return 0
98
else
109
return 1
1110
fi;
1211
}
1312

1413
function is_jruby {
14+
# RUBY_ENGINE only returns 'java' on JRuby. - does it? How about TruffleRuby?
1515
if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then
16-
# RUBY_ENGINE only returns 'ruby' on MRI.
17-
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
1816
return 0
1917
else
2018
return 1
2119
fi;
2220
}
2321

24-
function is_mri_192 {
25-
if is_mri; then
26-
if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then
27-
return 0
28-
else
29-
return 1
30-
fi
31-
else
32-
return 1
33-
fi
34-
}
35-
36-
function is_mri_192_plus {
37-
if is_mri; then
38-
if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then
39-
return 0
40-
else
41-
return 1
42-
fi
43-
else
44-
return 1
45-
fi
46-
}
47-
48-
function is_mri_2plus {
49-
if is_mri; then
50-
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then
51-
return 0
52-
else
53-
return 1
54-
fi
55-
else
56-
return 1
57-
fi
58-
}
59-
60-
function is_ruby_23_plus {
61-
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
62-
return 0
63-
else
64-
return 1
65-
fi
66-
}
67-
6822
function is_ruby_25_plus {
6923
if ruby -e "exit(RUBY_VERSION.to_f >= 2.5)"; then
7024
return 0
@@ -81,26 +35,14 @@ function rspec_rails_compatible {
8135
fi
8236
}
8337

84-
function rspec_support_compatible {
85-
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
86-
return 0
87-
else
88-
return 1
89-
fi
90-
}
91-
9238
function additional_specs_available {
9339
type run_additional_specs > /dev/null 2>&1
9440
return $?
9541
}
9642

9743
function documentation_enforced {
9844
if [ -x ./bin/yard ]; then
99-
if is_mri_2plus; then
100-
return 0
101-
else
102-
return 1
103-
fi
45+
return 0
10446
else
10547
return 1
10648
fi

0 commit comments

Comments
 (0)