Module: Capybara::Minitest::Assertions

Defined in:
lib/capybara/minitest.rb

Instance Method Summary collapse

Instance Method Details

#assert_ancestorObject


100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/capybara/minitest.rb', line 100

%w[selector no_selector matches_style
   all_of_selectors none_of_selectors any_of_selectors
   matches_selector not_matches_selector
   sibling no_sibling ancestor no_ancestor].each do |assertion_name|
  class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
    def assert_#{assertion_name} *args, &optional_filter_block
      self.assertions +=1
      subject, args = determine_subject(args)
      subject.assert_#{assertion_name}(*args, &optional_filter_block)
    rescue Capybara::ExpectationNotMet => e
      raise ::Minitest::Assertion, e.message
    end
  ASSERTION
  ruby2_keywords "assert_#{assertion_name}" if respond_to?(:ruby2_keywords)
end

#assert_buttonObject


# File 'lib/capybara/minitest.rb', line 215

#assert_checked_fieldObject


# File 'lib/capybara/minitest.rb', line 241

#assert_cssObject


# File 'lib/capybara/minitest.rb', line 189

#assert_current_pathObject


# File 'lib/capybara/minitest.rb', line 32

#assert_fieldObject


# File 'lib/capybara/minitest.rb', line 228


# File 'lib/capybara/minitest.rb', line 202

#assert_matches_selectorObject


# File 'lib/capybara/minitest.rb', line 75

#assert_matches_styleObject


# File 'lib/capybara/minitest.rb', line 85

#assert_no_buttonObject


# File 'lib/capybara/minitest.rb', line 221

#assert_no_checked_fieldObject

Assertion that there is no checked_field


# File 'lib/capybara/minitest.rb', line 247

#assert_no_cssObject


# File 'lib/capybara/minitest.rb', line 195

#assert_no_current_pathObject Also known as: refute_current_path


45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/capybara/minitest.rb', line 45

%w[text no_text title no_title current_path no_current_path].each do |assertion_name|
  class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
    def assert_#{assertion_name} *args
      self.assertions +=1
      subject, args = determine_subject(args)
      subject.assert_#{assertion_name}(*args)
    rescue Capybara::ExpectationNotMet => e
      raise ::Minitest::Assertion, e.message
    end
  ASSERTION
  ruby2_keywords "assert_#{assertion_name}" if respond_to?(:ruby2_keywords)
end

#assert_no_fieldObject


# File 'lib/capybara/minitest.rb', line 234

Assertion that there is no link


# File 'lib/capybara/minitest.rb', line 208

#assert_no_selectObject


# File 'lib/capybara/minitest.rb', line 271

#assert_no_selectorObject Also known as: refute_selector


# File 'lib/capybara/minitest.rb', line 70

#assert_no_textObject Also known as: refute_text


# File 'lib/capybara/minitest.rb', line 14

#assert_no_titleObject Also known as: refute_title


# File 'lib/capybara/minitest.rb', line 25

#assert_no_unchecked_fieldObject

Assertion that there is no unchecked_field


# File 'lib/capybara/minitest.rb', line 259

#assert_no_xpathObject


# File 'lib/capybara/minitest.rb', line 182

#assert_selectObject


# File 'lib/capybara/minitest.rb', line 265

#assert_selectorObject


# File 'lib/capybara/minitest.rb', line 65

#assert_siblingObject


# File 'lib/capybara/minitest.rb', line 90

#assert_tableObject


# File 'lib/capybara/minitest.rb', line 278

#assert_textObject Also known as: assert_content


# File 'lib/capybara/minitest.rb', line 9

#assert_titleObject


# File 'lib/capybara/minitest.rb', line 19

#assert_unchecked_fieldObject


# File 'lib/capybara/minitest.rb', line 253

#assert_xpathObject


# File 'lib/capybara/minitest.rb', line 80

#refute_buttonObject

Assertion that there is no button


# File 'lib/capybara/minitest.rb', line 221

#refute_checked_fieldObject

Assertion that there is no checked_field


# File 'lib/capybara/minitest.rb', line 247

#refute_cssObject

Assertion that there is no css


# File 'lib/capybara/minitest.rb', line 195

#refute_fieldObject

Assertion that there is no field


# File 'lib/capybara/minitest.rb', line 234


# File 'lib/capybara/minitest.rb', line 208

#refute_selectObject

Assertion that there is no select


# File 'lib/capybara/minitest.rb', line 271

#refute_unchecked_fieldObject

Assertion that there is no unchecked_field


# File 'lib/capybara/minitest.rb', line 259

#refute_xpathObject

Assertion that there is no xpath


# File 'lib/capybara/minitest.rb', line 182