Deprecate the custom exist matcher#68
Deprecate the custom exist matcher#68adamstegman merged 3 commits intoalexrothenberg:mainfrom adamstegman:rspec-exist
Conversation
Prefer the one built-in by RSpec instead. Fall back to the built-in matcher for default behavior when given a filename.
alexrothenberg
left a comment
There was a problem hiding this comment.
![]()
@adamstegman I added you as an collaborator here + owner in rubygems in case you want to merge and release this yourself
|
This loud deprecation broke RSpec's own CI, which is kept warning-free. It turned out funny that rspec-rails's specs were relying on the Ammeter's implementation of the Most certainly, we just need to clean this up in rspec-rails specs and use Is there a canonical way to transform a bunch of existing specs to work without warnings? subject { file('spec/models/posts_spec.rb') }
it { is_expected.to contain /require 'spec_helper'/ }
it { is_expected.to exist }What if we change the def file relative
- File.expand_path(relative, destination_root)
+ Pathname.new(File.expand_path(relative, destination_root))This worked to fix rspec-rails specs. to fix it: - expect(group.file('app/model/post.rb')).to eq "#{path_to_gem_root_tmp}/app/model/post.rb"
+ expect(group.file('app/model/post.rb').to_path).to eq "#{path_to_gem_root_tmp}/app/model/post.rb" |
|
Great idea! It feels pretty safe to me in general, but worth calling out as a potential breaking change. |
Prefer the one built-in by RSpec instead. Fall back to the built-in matcher for default behavior when given a filename.
Fixes #60