Skip to content

Commit 582d975

Browse files
committed
Fixed kwargs in *_of_selectors methods
1 parent b3325b1 commit 582d975

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

lib/capybara/minitest.rb

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,27 @@ module Assertions
4848
# @!method assert_no_current_path
4949
# See {Capybara::SessionMatchers#assert_no_current_path}
5050

51-
%w[text no_text title no_title current_path no_current_path].each do |assertion_name|
51+
##
52+
# Assert all of the provided selectors exist on page
53+
#
54+
# @!method assert_all_of_selectors
55+
# See {Capybara::Node::Matchers#assert_all_of_selectors}
56+
57+
##
58+
# Assert none of the provided selectors exist on page
59+
#
60+
# @!method assert_none_of_selectors
61+
# See {Capybara::Node::Matchers#assert_none_of_selectors}
62+
63+
##
64+
# Assert any of the provided selectors exist on page
65+
#
66+
# @!method assert_any_of_selectors
67+
# See {Capybara::Node::Matchers#assert_any_of_selectors}
68+
69+
70+
%w[text no_text title no_title current_path no_current_path
71+
all_of_selectors none_of_selectors any_of_selectors].each do |assertion_name|
5272
class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
5373
def assert_#{assertion_name}(*args, **kwargs, &optional_filter_block)
5474
self.assertions +=1
@@ -93,24 +113,6 @@ def assert_#{assertion_name}(*args, **kwargs, &optional_filter_block)
93113
# @!method assert_not_matches_selector
94114
# See {Capybara::Node::Matchers#assert_not_matches_selector}
95115

96-
##
97-
# Assert all of the provided selectors exist on page
98-
#
99-
# @!method assert_all_of_selectors
100-
# See {Capybara::Node::Matchers#assert_all_of_selectors}
101-
102-
##
103-
# Assert none of the provided selectors exist on page
104-
#
105-
# @!method assert_none_of_selectors
106-
# See {Capybara::Node::Matchers#assert_none_of_selectors}
107-
108-
##
109-
# Assert any of the provided selectors exist on page
110-
#
111-
# @!method assert_any_of_selectors
112-
# See {Capybara::Node::Matchers#assert_any_of_selectors}
113-
114116
##
115117
# Assert element has the provided CSS styles
116118
#
@@ -144,7 +146,6 @@ def assert_#{assertion_name}(*args, **kwargs, &optional_filter_block)
144146
# See {Capybara::Node::Matchers#assert_no_ancestor}
145147

146148
%w[selector no_selector matches_style
147-
all_of_selectors none_of_selectors any_of_selectors
148149
matches_selector not_matches_selector
149150
sibling no_sibling ancestor no_ancestor].each do |assertion_name|
150151
class_eval <<-ASSERTION, __FILE__, __LINE__ + 1

spec/minitest_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_assert_table
110110
end
111111

112112
def test_assert_all_of_selectors
113-
assert_all_of_selectors(:css, 'select#form_other_title', 'input#form_last_name')
113+
assert_all_of_selectors(:css, 'select#form_other_title', "input#form_super_secret", visible: false)
114114
end
115115

116116
def test_assert_none_of_selectors

spec/minitest_spec_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def self.test_order
9595
end
9696

9797
it 'supports all_of_selectors expectations' do
98-
_(page).must_have_all_of_selectors(:css, 'select#form_other_title', 'input#form_last_name')
98+
_(page).must_have_all_of_selectors(:css, 'select#form_other_title', "input#form_super_secret", visible: false)
9999
end
100100

101101
it 'supports none_of_selectors expectations' do
@@ -153,7 +153,7 @@ def self.test_order
153153
Capybara.use_default_driver
154154
end
155155

156-
it 'should support minitest spec' do
156+
it 'should support minitest spec', :focus_ do
157157
output = StringIO.new
158158
reporter = Minitest::SummaryReporter.new(output)
159159
reporter.start

0 commit comments

Comments
 (0)