sift 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sift/client.rb +1 -0
- data/lib/sift/version.rb +1 -1
- data/spec/unit/client_spec.rb +14 -3
- metadata +2 -2
data/lib/sift/client.rb
CHANGED
data/lib/sift/version.rb
CHANGED
data/spec/unit/client_spec.rb
CHANGED
@@ -51,21 +51,32 @@ describe Sift::Client do
|
|
51
51
|
lambda { Sift::Client.new("foo").score("") }.should raise_error
|
52
52
|
end
|
53
53
|
|
54
|
-
|
55
54
|
it "Doesn't raise an exception on Net/HTTP errors" do
|
56
55
|
|
57
|
-
|
58
56
|
api_key = "foobar"
|
59
57
|
event = "$transaction"
|
60
58
|
properties = valid_transaction_properties
|
61
59
|
|
62
60
|
stub_request(:any, /.*/).to_return(:status => 401)
|
63
61
|
|
64
|
-
# This method should just return
|
62
|
+
# This method should just return nil -- the track call failed because
|
65
63
|
# of an HTTP error
|
66
64
|
Sift::Client.new(api_key).track(event, properties).should eq(nil)
|
67
65
|
end
|
68
66
|
|
67
|
+
it "Returns nil when a StandardError occurs within the request" do
|
68
|
+
|
69
|
+
api_key = "foobar"
|
70
|
+
event = "$transaction"
|
71
|
+
properties = valid_transaction_properties
|
72
|
+
|
73
|
+
stub_request(:any, /.*/).to_raise(StandardError)
|
74
|
+
|
75
|
+
# This method should just return nil -- the track call failed because
|
76
|
+
# a StandardError exception was thrown
|
77
|
+
Sift::Client.new(api_key).track(event, properties).should eq(nil)
|
78
|
+
end
|
79
|
+
|
69
80
|
it "Successfuly handles an event and returns OK" do
|
70
81
|
|
71
82
|
response_json = { :status => 0, :error_message => "OK" }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|