restforce-db 2.6.0 → 2.7.0

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: 32070b017ebc49e12627f8c133e3f43a57e169f7
4
- data.tar.gz: 8c7acd0b14bd4c4163b642eebafc5a366f67d2a5
3
+ metadata.gz: c25a609455a6ec5468ec04c57c012cd8db246165
4
+ data.tar.gz: 5ecc15d30bd49ebb8926e5e4aa11665311776b0a
5
5
  SHA512:
6
- metadata.gz: 0999d0e8dd788636befc0110aa2545da6eead4715a5c002393ab31f566906335a19547fa568f008d41d44a754a9b851461c682e8812cf1b430c604717a1ef9c9
7
- data.tar.gz: f26d6f55ecdf463f96467f1e137d028e3eabe3a7e13fcded11fa5c566199e17e74f58d215e0d5eab74385093565f9381140fc6c24ea46859d4c3d087bbbb7124
6
+ metadata.gz: 447d000eae9fa2c955a8dc1cead5458e5b40fcc7a40bac9bf43f920a02f174b5b085b38ed289c486feeee33af74ae4574f44665fee5d68dfe34b95da16cd96e6
7
+ data.tar.gz: a69d6366987c9515962fcb2f465dd4c121744651eb5cf01291d2b7c1e7ad853c417ccc4006ad9aa5ea1f0fa00da95a15e958f18888ca94ea3bb974662e94367f
data/README.md CHANGED
@@ -280,6 +280,10 @@ restaurant.force_sync!
280
280
 
281
281
  You'll need to ensure that Restforce::DB is properly configured for your application (an initializer is recommended).
282
282
 
283
+ #### Testing
284
+
285
+ If you're testing your integration, and using something like VCR to record your specs, you may run into some spec order dependency issues due to Restforce::DB's global request caching. To prevent these dependencies in your spec suite, you can clear all cached data by invoking `Restforce::DB.reset` somewhere in your spec setup or teardown.
286
+
283
287
  ## System Caveats
284
288
 
285
289
  - **API Usage.**
data/lib/restforce/db.rb CHANGED
@@ -113,14 +113,31 @@ module Restforce
113
113
  configuration
114
114
  end
115
115
 
116
+ # Public: Clear all globally cached values for Restforce::DB.
117
+ #
118
+ # NOTE: This is an "idempotent" reset; following invocation, all functions
119
+ # should still work as before, but globally cached values will be
120
+ # repopulated.
121
+ #
122
+ # Returns nothing.
123
+ def self.reset
124
+ FieldProcessor.reset
125
+ @user_id = nil
126
+ @client = nil
127
+ end
128
+
116
129
  # Public: Eliminate all customizations to the current Restforce::DB
117
130
  # configuration and client.
118
131
  #
132
+ # NOTE: This is a hard reset; following invocation, Restforce::DB will need
133
+ # to be reconfigured in order for functionality to be restored.
134
+ #
119
135
  # Returns nothing.
120
- def self.reset
136
+ def self.reset!
137
+ reset
138
+
121
139
  @configuration = nil
122
- @client = nil
123
- @user_id = nil
140
+ @last_run = nil
124
141
  end
125
142
 
126
143
  end
@@ -3,7 +3,7 @@ module Restforce
3
3
  # :nodoc:
4
4
  module DB
5
5
 
6
- VERSION = "2.6.0"
6
+ VERSION = "2.7.0"
7
7
 
8
8
  end
9
9
 
@@ -5,13 +5,11 @@ def configure!
5
5
  end
6
6
 
7
7
  after do
8
- Restforce::DB::FieldProcessor.reset
9
- Restforce::DB::Registry.clean!
10
- Restforce::DB.last_run = nil
11
- Restforce::DB.logger = nil
12
-
13
8
  DatabaseCleaner.clean
14
9
  Salesforce.clean!
10
+
11
+ Restforce::DB::Registry.clean!
12
+ Restforce::DB.reset!
15
13
  end
16
14
  end
17
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-20 00:00:00.000000000 Z
11
+ date: 2015-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord