Module: Minitest::Capybara::Helpers
- Defined in:
- lib/minitest/capybara/helpers.rb
Class Method Summary collapse
- .count_message(options) ⇒ Object
- .declension(singular, plural, count) ⇒ Object
- .failure_message(description, options = {}) ⇒ Object
- .negative_failure_message(description, options = {}) ⇒ Object
Class Method Details
.count_message(options) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/minitest/capybara/helpers.rb', line 20 def self.() if [:count] " #{[:count]} #{declension('time', 'times', [:count])}" elsif [:between] " between #{[:between].first} and #{[:between].last} times" elsif [:maximum] " at most #{[:maximum]} #{declension('time', 'times', [:maximum])}" elsif [:minimum] " at least #{[:minimum]} #{declension('time', 'times', [:minimum])}" else "" end end |
.declension(singular, plural, count) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/minitest/capybara/helpers.rb', line 12 def self.declension(singular, plural, count) if count == 1 singular else plural end end |
.failure_message(description, options = {}) ⇒ Object
4 5 6 |
# File 'lib/minitest/capybara/helpers.rb', line 4 def self.(description, ={}) "expected to find #{description}" + () end |
.negative_failure_message(description, options = {}) ⇒ Object
8 9 10 |
# File 'lib/minitest/capybara/helpers.rb', line 8 def self.(description, ={}) "expected not to find #{description}" + () end |