module Capybara::RSpecMatchers::CountSugar

Public Instance Methods

at_least(number) click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 20
def at_least(number)
  options[:minimum] = number
  self
end
at_most(number) click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 15
def at_most(number)
  options[:maximum] = number
  self
end
exactly(number) click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 10
def exactly(number)
  options[:count] = number
  self
end
once() click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 6
def once; exactly(1); end
thrice() click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 8
def thrice; exactly(3); end
times() click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 25
def times
  self
end
twice() click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 7
def twice; exactly(2); end

Private Instance Methods

options() click to toggle source
# File lib/capybara/rspec/matchers/count_sugar.rb, line 31
def options
  (@args.last.is_a?(Hash) ? @args : @args.push({})).last
end