eroi 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{eroi}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["CardPlayer"]
@@ -46,11 +46,11 @@ module EROI
46
46
  :clear_record => 1 ))
47
47
  end
48
48
 
49
- def define_list(list, records)
49
+ def define_list(list, emails)
50
50
  xml = Builder::XmlMarkup.new
51
51
  xml.tag!('DefineMailingList', 'list' => list) do |x|
52
- records.each do |r|
53
- x.tag!('Email', r.email)
52
+ emails.each do |email|
53
+ x.tag!('Email', email)
54
54
  end
55
55
  end
56
56
 
@@ -108,6 +108,15 @@ class TestClient < Test::Unit::TestCase
108
108
  end
109
109
  end
110
110
 
111
+ context "when defining a list" do
112
+ should "respond with a success" do
113
+ response = @client.define_list('TestList', [ 'longbob@longbob.com' ])
114
+
115
+ assert_equal true, response.success?
116
+ assert_equal 1, response.number_of_records
117
+ end
118
+ end
119
+
111
120
  context "when sending an edition" do
112
121
  setup do
113
122
  @xml = mock('Builder::XmlMarkup')
@@ -156,6 +156,22 @@ class TestClient < Test::Unit::TestCase
156
156
  end
157
157
  end
158
158
 
159
+ context "when defining a list" do
160
+ teardown do
161
+ @client.remove_contact('longbob@longbob.com')
162
+ @client.remove_contact('shortbob@shortbob.com')
163
+ end
164
+
165
+ should "respond with a success" do
166
+ response = @client.define_list(
167
+ 'TestList',
168
+ [ 'longbob@longbob.com', 'shortbob@shortbob.com' ])
169
+
170
+ assert_equal true, response.success?
171
+ assert_equal 2, response.number_of_records
172
+ end
173
+ end
174
+
159
175
  context "when sending an email to a contact" do
160
176
  teardown do
161
177
  @client.remove_contact('longbob@longbob.com')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eroi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CardPlayer