class Webspicy::Tester::Fakeses

Constants

DEFAULT_OPTIONS

Attributes

options[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/webspicy/tester/fakeses.rb, line 12
def initialize(options = {})
  @options = DEFAULT_OPTIONS.merge(options)
end

Public Instance Methods

clear!() click to toggle source
# File lib/webspicy/tester/fakeses.rb, line 21
def clear!
  res = HTTP.post("#{endpoint}/reset")
end
emails() click to toggle source
# File lib/webspicy/tester/fakeses.rb, line 25
def emails
  res = HTTP.get("#{endpoint}/emails")
  JSON.parse(res.body).map{|data| Email.new(data) }
end
emails_count() click to toggle source
# File lib/webspicy/tester/fakeses.rb, line 30
def emails_count
  emails.length
end
endpoint() click to toggle source
# File lib/webspicy/tester/fakeses.rb, line 17
def endpoint
  options[:endpoint]
end
last_email() click to toggle source
# File lib/webspicy/tester/fakeses.rb, line 34
def last_email
  emails.last
end