forked from eliotsykes/rspec-rails-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatchers.rb
More file actions
21 lines (16 loc) · 687 Bytes
/
matchers.rb
File metadata and controls
21 lines (16 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Setting up Custom Matchers:
# 0. Check spec/support dir is auto-required in spec/rails_helper.rb.
#
# 1. Create a file like this one you're reading in spec/support/matchers.rb:
Dir[Rails.root.join("spec/matchers/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.include Matchers
end
# 2. Write custom matcher classes in spec/matchers/ directory
#
# Each matcher class will need to be in a module called
# "Matchers" to work with the RSpec configuration specified
# above, see the spec/matchers directory for an example.
# Suggested docs
# --------------
# "Custom Matchers" section at http://www.rubydoc.info/gems/rspec-expectations/RSpec/Matchers