sift 1.1.3 → 1.1.4

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/lib/sift/client.rb CHANGED
@@ -107,6 +107,7 @@ module Sift
107
107
  rescue StandardError => e
108
108
  Sift.warn("Failed to track event: " + e.to_s)
109
109
  Sift.warn(e.backtrace)
110
+ nil
110
111
  end
111
112
  end
112
113
 
data/lib/sift/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sift
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -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 false -- the track call failed because
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.3
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: 2013-12-10 00:00:00.000000000 Z
12
+ date: 2014-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec