Skip to content

Commit

Permalink
Merge pull request #615 from varvet/drop-support-for-rspec-2
Browse files Browse the repository at this point in the history
Drop support for RSpec 2
  • Loading branch information
dgmstuart authored Aug 23, 2019
2 parents 6c1df63 + f252293 commit 1d53fd3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Removed

- Dropped support for Ruby end-of-life versions: 2.1 and 2.2.
- Dropped support for RSpec 2

## 2.1.0 (2019-08-14)

Expand Down
20 changes: 5 additions & 15 deletions lib/pundit/rspec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "active_support/core_ext/array/conversions"

module Pundit
module RSpec
module Matchers
Expand Down Expand Up @@ -74,17 +72,9 @@ def self.included(base)
end

RSpec.configure do |config|
if RSpec::Core::Version::STRING.split(".").first.to_i >= 3
config.include(
Pundit::RSpec::PolicyExampleGroup,
type: :policy,
file_path: %r{spec/policies}
)
else
config.include(
Pundit::RSpec::PolicyExampleGroup,
type: :policy,
example_group: { file_path: %r{spec/policies} }
)
end
config.include(
Pundit::RSpec::PolicyExampleGroup,
type: :policy,
file_path: %r{spec/policies}
)
end
2 changes: 1 addition & 1 deletion pundit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "bundler"
gem.add_development_dependency "pry"
gem.add_development_dependency "rake"
gem.add_development_dependency "rspec", ">= 2.0.0"
gem.add_development_dependency "rspec", ">= 3.0.0"
gem.add_development_dependency "rubocop", "0.74.0"
gem.add_development_dependency "yard"
end
16 changes: 0 additions & 16 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@
require "active_model/naming"
require "action_controller/metal/strong_parameters"

I18n.enforce_available_locales = false

module PunditSpecHelper
extend RSpec::Matchers::DSL

matcher :be_truthy do
match do |actual|
actual
end
end
end

RSpec.configure do |config|
config.include PunditSpecHelper
end

class PostPolicy < Struct.new(:user, :post)
class Scope < Struct.new(:user, :scope)
def resolve
Expand Down

0 comments on commit 1d53fd3

Please sign in to comment.