8000 Merge pull request #208 from rspec/update-development-from-root-direc… · rspec/rspec@908a24c · GitHub
[go: up one dir, main page]

Skip to content

Commit 908a24c

Browse files
authored
Merge pull request #208 from rspec/update-development-from-root-directory
Update development.md to clarify libraries
2 parents d064fd0 + d7377ae commit 908a24c

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

DEVELOPMENT.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ $ bundle install
1818

1919
## Working on an individual library
2020

21-
For most contributors, setting up the project individually will be simpler.
21+
Each rspec-* library is a standalone gem, with a standalone build. We recommend you
22+
treat each as such and run development tools from their individual directories.
23+
24+
For convience though, you can also run `script/run_rspec` from the root directory
25+
to run all the specs, as well as `bin/rubocop` to check all files for recommendations
26+
at once.
27+
28+
# Bundler setup
2229

23-
Unless you have a specific reason to use rspec-dev, we recommend using this approach.
2430
To minimize boot time and to ensure we don't depend upon any extra dependencies
2531
loaded by Bundler, our CI builds avoid loading Bundler at runtime
2632
by using Bundler's [`--standalone option`](https://myronmars.to/n/dev-blog/2012/03/faster-test-boot-times-with-bundler-standalone).
@@ -29,14 +35,17 @@ While not strictly necessary (many/most of our contributors do not do this!),
2935
if you want to exactly reproduce our CI builds you'll want to do the same:
3036

3137
```
38+
$ rm Gemfile.lock
3239
$ bundle install --standalone --path <current_lib>/bundle
3340
$ bundle binstubs --path <current_lib>/bundle/bin
3441
```
3542

3643
The `binstubs` option creates the `bin/rspec` file that, like `bundle exec rspec`, will load
3744
all the versions specified in `Gemfile.lock` without loading bundler at runtime!
3845

39-
You can also run `bundle install` as normal with the GEMFILE environment variable set to the parent directory.
46+
Note that as a set of gems we don't check in `Gemfile.lock`, so to replicate a CI build on branch
47+
changes / after a period of time you will need to delete your local `Gemfile.lock` file to install
48+
the same gems as CI.
4049

4150
## Extra Gems
4251

@@ -48,10 +57,12 @@ gem declarations. The `Gemfile` evaluates that file if it exists, and it is git-
4857

4958
The [CI build](https://github.com/rspec/rspec/actions)
5059
runs many verification steps to prevent regressions and
51-
ensure high-quality code. To run the build locally, for an individual libraryrun:
60+
ensure high-quality code. To run the build locally, for an individual library run:
5261

5362
```
54-
$ script/run_build
63+
$ ../script/run_rspec
64+
$ ../script/run_rspec_one_by_one
65+
$ ../script/run_cucumber
5566
```
5667

5768
See [build detail](BUILD_DETAIL.md) for more detail.

rspec-mocks/lib/rspec/mocks/verifying_double.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ def method_missing(message, *args, &block)
3636

3737
# Redefining `__send__` causes ruby to issue a warning.
3838
old, $VERBOSE = $VERBOSE, nil
39+
# rubocop:disable Naming/MethodName
3940
def __send__(name, *args, &block)
4041
@__sending_message = name
4142
super
4243
ensure
4344
@__sending_message = nil
4445
end
46+
# rubocop:enable Naming/MethodName
4547
ruby2_keywords :__send__ if respond_to?(:ruby2_keywords, true)
4648
$VERBOSE = old
4749

script/run_rspec

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,23 @@ function run_specs {
1313
rspec_bin=script/rspec_with_simplecov
1414
fi;
1515

16-
echo "${PWD}/bin/rspec"
17-
$rspec_bin spec --backtrace --format progress --profile --format progress
16+
if [ $PWD -ef $ROOT_DIR ]; then
17+
echo "In root directory... running all specs..."
18+
19+
for dir in "$ROOT_DIR"/*/ ; do
20+
dir=${dir%/}
21+
22+
if [ -d "$dir/spec" ]; then
23+
echo "${PWD}/bin/rspec spec in ${dir}"
24+
pushd $dir
25+
$rspec_bin spec --backtrace --format progress --profile --format progress
26+
popd
27+
fi
28+
done
29+
else
30+
echo "${PWD}/bin/rspec spec"
31+
$rspec_bin spec --backtrace --format progress --profile --format progress
32+
fi;
1833
}
1934

2035
run_specs

0 commit comments

Comments
 (0)
0