streamsend 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ require File.join(Dir.pwd, "lib/streamsend")
4
+ require "integration/spec_helper"
5
+ require File.expand_path(__FILE__, "../../exception")
6
+
7
+ module StreamSend
8
+ module Api
9
+ describe "Subscriber" do
10
+ before do
11
+ @account = StreamSend::Api::IntegrationConfiguration.root_account
12
+ StreamSend::Api.configure(@account.api_username, @account.api_password, @account.app_host)
13
+ end
14
+
15
+ describe "with no matching subscriber" do
16
+ it "returns nil" do
17
+ VCR.use_cassette('streamsend') do
18
+ expect(StreamSend::Api::Subscriber.find("bad.email@gmail.com")).to be_nil
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,7 +1,6 @@
1
1
  require "spec_helper"
2
2
  require File.join(Dir.pwd, "lib/streamsend")
3
3
  require "integration/spec_helper.rb"
4
- require "debugger"
5
4
 
6
5
  describe "user via api" do
7
6
  before do
@@ -33,6 +33,15 @@ module StreamSend
33
33
  it "should return the id of the first audience" do
34
34
  StreamSend::Api::Subscriber.audience_id.should == 2
35
35
  end
36
+
37
+ it "should throw an error on failure" do
38
+ xml = <<-XML
39
+ <?xml version="1.0" encoding="UTF-8"?>
40
+ <foo></foo>
41
+ XML
42
+ stub_http_request(:get, "http://#{@username}:#{@password}@#{@host}/audiences.xml").to_return(:body => xml)
43
+ expect { StreamSend::Api::Subscriber.audience_id.should == 2 }.to raise_error(StreamSend::Api::Exception)
44
+ end
36
45
  end
37
46
 
38
47
  describe ".clear_audience" do
data/streamsend.gemspec CHANGED
@@ -11,15 +11,16 @@ Gem::Specification.new do |gem|
11
11
  gem.add_dependency "httparty"
12
12
  gem.add_dependency "activesupport", "~>3.2"
13
13
  gem.add_dependency "builder"
14
- gem.add_development_dependency "debugger"
15
14
  gem.add_development_dependency "rspec"
16
15
  gem.add_development_dependency "webmock", "~> 1.6"
17
16
  gem.add_development_dependency "vcr"
17
+ gem.add_development_dependency "watchr"
18
+ gem.add_development_dependency "ruby-fsevent"
18
19
 
19
20
  gem.files = `git ls-files`.split($\)
20
21
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
21
22
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
22
23
  gem.name = "streamsend"
23
24
  gem.require_paths = ["lib"]
24
- gem.version = "0.2.0"
25
+ gem.version = "0.2.1"
25
26
  end
data/watcher_config.rb ADDED
@@ -0,0 +1,2 @@
1
+ watch("spec/(.*)\.rb") { |md| system("rspec #{md[0]}") }
2
+ watch("lib/(.*)\.rb") { |md| system("rspec spec/") }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streamsend
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
  - Scott Albertson
@@ -54,7 +54,7 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
- name: debugger
57
+ name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - '>='
@@ -68,7 +68,21 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
- name: rspec
71
+ name: webmock
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: '1.6'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: '1.6'
84
+ - !ruby/object:Gem::Dependency
85
+ name: vcr
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - '>='
@@ -82,21 +96,21 @@ dependencies:
82
96
  - !ruby/object:Gem::Version
83
97
  version: '0'
84
98
  - !ruby/object:Gem::Dependency
85
- name: webmock
99
+ name: watchr
86
100
  requirement: !ruby/object:Gem::Requirement
87
101
  requirements:
88
- - - ~>
102
+ - - '>='
89
103
  - !ruby/object:Gem::Version
90
- version: '1.6'
104
+ version: '0'
91
105
  type: :development
92
106
  prerelease: false
93
107
  version_requirements: !ruby/object:Gem::Requirement
94
108
  requirements:
95
- - - ~>
109
+ - - '>='
96
110
  - !ruby/object:Gem::Version
97
- version: '1.6'
111
+ version: '0'
98
112
  - !ruby/object:Gem::Dependency
99
- name: vcr
113
+ name: ruby-fsevent
100
114
  requirement: !ruby/object:Gem::Requirement
101
115
  requirements:
102
116
  - - '>='
@@ -129,9 +143,11 @@ files:
129
143
  - lib/streamsend/api/subscriber.rb
130
144
  - lib/streamsend/api/user.rb
131
145
  - spec/integration/account_spec.rb
146
+ - spec/integration/fixtures/vcr_cassettes/streamsend.yml
132
147
  - spec/integration/integration.yml
133
148
  - spec/integration/list_spec.rb
134
149
  - spec/integration/spec_helper.rb
150
+ - spec/integration/subscriber_spec.rb
135
151
  - spec/integration/user_spec.rb
136
152
  - spec/lib/streamsend/api/list_spec.rb
137
153
  - spec/lib/streamsend/api/resource_spec.rb
@@ -140,6 +156,7 @@ files:
140
156
  - spec/lib/streamsend/api_spec.rb
141
157
  - spec/spec_helper.rb
142
158
  - streamsend.gemspec
159
+ - watcher_config.rb
143
160
  homepage: https://github.com/Jeff-R/streamsend-ruby
144
161
  licenses: []
145
162
  metadata: {}
@@ -165,9 +182,11 @@ specification_version: 4
165
182
  summary: Ruby wrapper for the StreamSend API.
166
183
  test_files:
167
184
  - spec/integration/account_spec.rb
185
+ - spec/integration/fixtures/vcr_cassettes/streamsend.yml
168
186
  - spec/integration/integration.yml
169
187
  - spec/integration/list_spec.rb
170
188
  - spec/integration/spec_helper.rb
189
+ - spec/integration/subscriber_spec.rb
171
190
  - spec/integration/user_spec.rb
172
191
  - spec/lib/streamsend/api/list_spec.rb
173
192
  - spec/lib/streamsend/api/resource_spec.rb