File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323# Start SimpleCov
2424SimpleCov . start do
25- formatter SimpleCov ::Formatter ::MultiFormatter . new ( [ SimpleCov ::Formatter ::HTMLFormatter , SimpleCov ::Formatter ::JSONFormatter ] )
25+ formatter SimpleCov ::Formatter ::MultiFormatter . new ( [ SimpleCov ::Formatter ::HTMLFormatter ,
26+ SimpleCov ::Formatter ::JSONFormatter ] )
2627 add_filter 'spec/'
2728end
2829
@@ -134,6 +135,21 @@ def setup_items(container) # rubocop:disable Metrics/AbcSize
134135 end
135136end
136137
138+ RSpec ::Matchers . define :have_no_css do |expected |
139+ match do |actual |
140+ selector = Nokogiri ::HTML ( actual ) . css ( expected )
141+ expect ( selector . size ) . to eq 0
142+ end
143+
144+ failure_message do |actual |
145+ "expected #{ actual } to have no elements matching '#{ expected } '"
146+ end
147+
148+ failure_message_when_negated do |actual |
149+ "expected #{ actual } to have elements matching '#{ expected } '"
150+ end
151+ end
152+
137153# Configure RSpec with Rails
138154begin
139155 require 'rails'
You can’t perform that action at this time.
0 commit comments