{"id":16948090,"url":"https://github.com/technicalpickles/mailinator-spec","last_synced_at":"2025-09-26T21:30:48.887Z","repository":{"id":56893088,"uuid":"710816","full_name":"technicalpickles/mailinator-spec","owner":"technicalpickles","description":"a library for using mailinator for testing email from rspec and cucumber","archived":false,"fork":false,"pushed_at":"2010-06-28T23:09:52.000Z","size":102,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-24T08:39:49.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technicalpickles.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-06-09T03:12:43.000Z","updated_at":"2022-03-29T21:31:09.000Z","dependencies_parsed_at":"2022-08-21T01:20:47.049Z","dependency_job_id":null,"html_url":"https://github.com/technicalpickles/mailinator-spec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fmailinator-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fmailinator-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fmailinator-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fmailinator-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technicalpickles","download_url":"https://codeload.github.com/technicalpickles/mailinator-spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231722057,"owners_count":18416599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:49:35.813Z","updated_at":"2025-09-26T21:30:48.569Z","avatar_url":"https://github.com/technicalpickles.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= mailinator-spec\n\nMailinator is a great little service that provides you with temporary email addresses, and provides a way to access. You can send email to any address at mailinator.com, and you're able to access that from the a browser or through rss and atom. \n\nNow, imagine you are doing integration tests of funcaionality that send email. Ideally, you'd want to actually send the email, and verify that the message went through. Feasibly, you could send the  email to mailinator and then use their atom feed to check that the email went through. This is essentially what mailinator-spec comes in.\n\n\n  Scenario: Cucumber integration\n    Given I have mailinator email address\n    And I've manually sent an email to it\n    When I wait 2 seconds for mail to process\n    Then the email subject should match /omgwtfbbq/\n    And the email body should match /http:\\/\\/zombo\\.com/\n\n\n== Setup\n\nStart off with the usual gem install:\n\n  gem install mailinator-spec\n\nmailinator-spec comes with two main modules:\n\n * Mailinator::Spec::Matchers\n * Mailinator::Spec::Helpers\n\nFor RSpec, you can add these to spec/spec_helper.rb:\n\n  require 'mailinator'\n  Spec::Runner.configure do |config|\n    config.include Mailinator::Spec::Matchers\n    config.include Mailinator::Spec::Helpers\n  end\n\nIt's also usable from cucumber:\n\n  require 'mailinator/spec'\n  require 'mailinator/steps'\n  World(Mailinator::Spec::Matchers)\n  World(Mailinator::Spec::Helpers)\n\n== Usage\n\nAt the core of mailinator-spec is the Mailinator class. This represents a mailbox over at http://mailinator.com. It provides you an easy way to get URLs for accessing the mailbox, as well as providing TMail objects of the emails in the mailbox.\n\n  mailinator = Mailinator.new('zombo-consumer')\n  mailinator.email # =\u003e \"zombo-consumer@mailinator.com\"\n  mailinator.inbox_url # =\u003e \"http://mailinator.com/maildir.jsp?email=zombo-consumer@mailinator.com\"\n  mailinator.rss_url # =\u003e \"http://mailinator.com/rss.jsp?email=zombo-consumer@mailinator.com\"\n  mailinator.atom_url # =\u003e \"http://mailinator.com/atom.jsp?email=zombo-consumer@mailinator.com\"\n  mailinator.mailbox # =\u003e [#\u003cTMail::Mail port=#\u003cTMail::StringPort:id=0x8110d1d8\u003e bodyport=#\u003cTMail::StringPort:id=0x8110c0f8\u003e\u003e]\n  mailinator.mailbox.first.from # =\u003e \"noreply@zombo.com\"\n  mailinator.mailbox.first.subject # =\u003e \"Welcome to zombo.com!\"\n  mailinator.mailbox.first.to # =\u003e \"The only limitation... is you!\"\n  mailinator.mailbox.first.body # =\u003e \"The only limitation... is you!\"\n\nYou might not actually care what the address is that you receive email to. For this case, there's a convenience method for creating a (mostly) random one:\n\n  mailinator = Mailinator.mostly_random\n  mailinator.email # =\u003e \"7d6f4373dbfde6a698f1000eb@mailinator.com\"\n  mailinator = Mailinator.new('zombo-consumer')\n  mailinator.email # =\u003e \"zombo-consumer@mailinator.com\"\n\nYou can also change which domain is used for the email address. This is useful if your application specifically prevents users from using mailinator addresses.\n\n  Mailinator.domain = 'mailinator.zombo.com'\n  mailinator = Mailinator.new('zombo-consumer')\n  mailinator.email # =\u003e \"zombo-consumer@mailinator.zombo.com\"\n\nFor this to properly work, you'd need to FIXME to provide that information\n\n\nFor RSpec and Cucumber, this is exposed slightly more convenient way, and there are matchers (courtesy of email-spec)\n\n   describe \"zombo.com welcome\" do\n     before do\n       @to = mailinator.email # for a random address\n       # @to = mailinator('me') # for a specific address\n\n       # send some email\n\n       @email = last_mailinator_email # shorthand for mailinator.mailbox.last\n     end\n\n     it \"is from noreply@zombo.com\" do\n       @email.should be_delivered_from('noreply@zombo.com')\n     end\n\n     it \"has welcoming subject\" do\n       @email.should have_subject('Welcome to zombo.com')\n     end\n\n     it \"tells us our about our limitation\" do\n       @email.should have_body_text(\"The only limitation... is you!\")\n     end\n   end\n\nIn cucumber, you can use the same exact techniques. In addition, there are handful of step definitions provided:\n\n    When I wait 2 seconds for mail to process\n    Then the email subject should match /omgwtfbbq/\n    And the email body should match /http:\\/\\/zombo\\.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Fmailinator-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnicalpickles%2Fmailinator-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Fmailinator-spec/lists"}