123456789_123456789_123456789_123456789_123456789_

Module: Capybara::RSpecMatchers::CountSugar

Instance Method Summary

Instance Method Details

#at_least(number)

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 20

def at_least(number)
  options[:minimum] = number
  self
end

#at_most(number)

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 15

def at_most(number)
  options[:maximum] = number
  self
end

#exactly(number)

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 10

def exactly(number)
  options[:count] = number
  self
end

#once

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 6

def once; exactly(1); end

#options (private)

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 31

def options
  # (@args.last.is_a?(Hash) ? @args : @args.push({})).last
  @kw_args
end

#thrice

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 8

def thrice; exactly(3); end

#times

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 25

def times
  self
end

#twice

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/count_sugar.rb', line 7

def twice; exactly(2); end