Skip to content

Commit

Permalink
Use RSpec 4 pre-release
Browse files Browse the repository at this point in the history
RSpec 4 will eventually be released. Since we're checking its style, why
don't we add a job to use it to run our specs.
This will help a bit to test RSpec 4 out.
  • Loading branch information
pirj committed Jul 10, 2022
1 parent 54b49a6 commit a004d11
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,24 @@ jobs:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- run: bundle exec rake ${{ matrix.task }}

rspec4:
runs-on: ubuntu-latest
name: RSpec 4
steps:
- uses: actions/checkout@v2
- name: Use latest RSpec 4 from `4-0-dev` branch
run: |
sed -e '/rspec/d' -i Gemfile
cat << EOF > Gemfile.local
gem 'rspec', github: 'rspec/rspec', branch: '4-0-dev'
gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev'
gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: '4-0-dev'
gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: '4-0-dev'
gem 'rspec-support', github: 'rspec/rspec-support', branch: '4-0-dev'
EOF
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- run: bundle exec rake spec
1 change: 0 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
--require spec_helper
--color
--format documentation
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gemspec

gem 'rack'
gem 'rake'
gem 'rspec', '>= 3.4'
gem 'rspec', '~> 3.11'
gem 'rubocop-performance', '~> 1.7'
gem 'rubocop-rake', '~> 0.6'
gem 'yard'
Expand Down
2 changes: 1 addition & 1 deletion spec/smoke_tests/weird_rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
end

it_behaves_like :something
it_should_behave_like :something
it_should_behave_like :something if RSpec::Core::Version::STRING < '4.0'

it_behaves_like :something do
let(:foo) { 'bar' }
Expand Down
6 changes: 1 addition & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ module SpecHelper
config.order = :random

# Run focused tests with `fdescribe`, `fit`, `:focus` etc.
config.filter_run focus: true
config.run_all_when_everything_filtered = true

# Forbid RSpec from monkey patching any of our objects
config.disable_monkey_patching!
config.filter_run_when_matching :focus

# We should address configuration warnings when we upgrade
config.raise_errors_for_deprecations!
Expand Down

0 comments on commit a004d11

Please sign in to comment.