cucumber-mailcatcher 0.8 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2b61bc92a239d119071b3bc29c7cd2a8f8d9c82
4
- data.tar.gz: 0fb4aa0bc30d90e88c79485a76199bd525068c99
3
+ metadata.gz: 2f302cf4686dd159d158da718fc421d3eb7ee05a
4
+ data.tar.gz: 5923b1530c63fe0c9264e154415628f91a49a2aa
5
5
  SHA512:
6
- metadata.gz: b6499715c327435a3f054779c8c25ac75bcd1ec77b95d9e3a5b763409136cd95717c019cf51f41be6ec51d7a926378baa67a325bbe969ea2d9390cf71b0a4fad
7
- data.tar.gz: 5dd2f706248129ab5e3c68ac825908a621745b14e7167c1d5ffd3bc96128184de79d2ad22e89c6d9d6d80e1cd73e2f63ab60bc55880b0809b1495c23e836b760
6
+ metadata.gz: 115b99aef3eea27156021cbaf9a2e60534b76622a03fc98d3224e8851e21d7b090dd6ffc0c98e801732440b5375c4d236196b16300724d2b53ef4ea0e44e0417
7
+ data.tar.gz: a90851ab6c87eb8262d9642b714fad95c75f7bdf0a7c13e7de580a071de14eb41f9b042b19f7da161c6751f7752ef4fdf9b22636ed872d1d5612e4fc80cb7a01
@@ -7,6 +7,8 @@ module Cucumber
7
7
  module Mailcatcher
8
8
 
9
9
  class HttpClient
10
+ @@server_url = nil
11
+
10
12
  def self.server_url
11
13
  @@server_url
12
14
  end
@@ -17,9 +19,8 @@ module Cucumber
17
19
 
18
20
  def initialize
19
21
  error = "Please set the Mailcatcher server url e.g. Cucumber::Mailcatcher::Api.server_url = 'http://localhost:1080'"
20
- begin
21
- valid = @@server_url =~ /\A#{URI.regexp(%w(http https))}\z/
22
- end
22
+
23
+ valid = @@server_url =~ /\A#{URI.regexp(%w(http https))}\z/
23
24
 
24
25
  raise error unless valid
25
26
  end
@@ -2,6 +2,6 @@ module Cucumber
2
2
  module Mailcatcher
3
3
  NAME = "cucumber-mailcatcher"
4
4
  FOLDER = "cucumber/mailcatcher"
5
- VERSION = "0.8"
5
+ VERSION = "0.9"
6
6
  end
7
7
  end
@@ -8,31 +8,31 @@ require 'cucumber/mailcatcher/http_client.rb'
8
8
  require 'cucumber/mailcatcher/version.rb'
9
9
 
10
10
  Then /^I should receive (\d+) email from "(.*?)"$/ do |count, address|
11
- http = Cucumber::Mailcatcher::HttpClient.new
12
- messages = http.get_messages_from_email address
11
+ api = Cucumber::Mailcatcher::Api.new Cucumber::Mailcatcher::HttpClient.new
12
+ messages = api.get_messages_from_email address
13
13
  expect(messages.length).to be count.to_i
14
14
  end
15
15
 
16
16
  Then /^I should receive (\d+) email sent to "(.*?)"$/ do |count, address|
17
- http = Cucumber::Mailcatcher::HttpClient.new
18
- messages = http.get_messages_to_email address
17
+ api = Cucumber::Mailcatcher::Api.new Cucumber::Mailcatcher::HttpClient.new
18
+ messages = api.get_messages_to_email address
19
19
  expect(messages.length).to be count.to_i
20
20
  end
21
21
 
22
22
  Then /^I should receive (\d+) email with subject "(.*?)"$/ do |count, subject|
23
- http = Cucumber::Mailcatcher::HttpClient.new
24
- messages = http.get_messages_with_subject subject
23
+ api = Cucumber::Mailcatcher::Api.new Cucumber::Mailcatcher::HttpClient.new
24
+ messages = api.get_messages_with_subject subject
25
25
  expect(messages.length).to be count.to_i
26
26
  end
27
27
 
28
28
  Then /^I should receive (\d+) email with a html body containing "(.*?)"$/ do |count, body|
29
- http = Cucumber::Mailcatcher::HttpClient.new
30
- messages = http.get_messages_with_html_body body
29
+ api = Cucumber::Mailcatcher::Api.new Cucumber::Mailcatcher::HttpClient.new
30
+ messages = api.get_messages_with_html_body body
31
31
  expect(messages.length).to be count.to_i
32
32
  end
33
33
 
34
34
  Then /^I should receive (\d+) email with a plain body containing "(.*?)"$/ do |count, body|
35
- http = Cucumber::Mailcatcher::HttpClient.new
36
- messages = http.get_messages_with_plain_body body
35
+ api = Cucumber::Mailcatcher::Api.new Cucumber::Mailcatcher::HttpClient.new
36
+ messages = api.get_messages_with_plain_body body
37
37
  expect(messages.length).to be count.to_i
38
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-mailcatcher
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson