Skip to content

Commit

Permalink
Update matchers to be compatible with RSpec 3 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgunther authored and avit committed Jan 18, 2018
1 parent d2ef752 commit 57935f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/rspec-rails-caching/matchers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ def self.caching_matcher name, &block
"#{cache_or_expire} #{expected.inspect}"
end

failure_message_for_should_not do |actual|
failure_message_when_negated do |actual|
"Expected #{controller.class} not to #{cache_or_expire} #{expected.inspect} but got #{cache_results.inspect}"
end

failure_message_for_should do |actual|
failure_message do |actual|
"Expected #{controller.class} to #{cache_or_expire} #{expected.inspect} but got #{cache_results.inspect}"
end

def controller
matcher_execution_context.controller
def supports_block_expectations?
true
end

def cache_store
Expand All @@ -37,7 +37,7 @@ def cache_or_expire
fail NoMethodError, "Abstract method 'cache_or_expire' to be defined in matcher"
end

instance_eval &block
module_eval &block

end
end
Expand Down
4 changes: 2 additions & 2 deletions rspec-rails-caching.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Gem::Specification.new do |gem|
gem.required_ruby_version = Gem::Requirement.new(">= 2.0.0")

gem.add_dependency "rails", ">=3.0.0"
gem.add_dependency "rspec", ">=2.8.0"
gem.add_dependency "rspec-rails", ">=2.10.0"
gem.add_dependency "rspec", ">=3.0.0"
gem.add_dependency "rspec-rails", ">=3.0.0"

gem.files = `git ls-files`.split($\)
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
Expand Down

0 comments on commit 57935f1

Please sign in to comment.