vault-test-tools 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,13 +15,19 @@ module Vault::Test
15
15
 
16
16
  # memoizes return value so we don't keep making a request
17
17
  def vault_spec(filename)
18
- var_name = "@#{filename.gsub(".",'_')}".to_sym
19
- spec_value = instance_variable_get(var_name)
20
- return spec_value if spec_value
21
- instance_variable_set(var_name, read_spec(filename))
18
+ return cache[filename] if cache[filename]
19
+ cache[filename] = read_spec(filename)
20
+ end
21
+
22
+ def reset_vault_specs!
23
+ @@cache = {}
22
24
  end
23
25
 
24
26
  protected
27
+ def cache
28
+ @@cache ||= {}
29
+ end
30
+
25
31
  def url(name)
26
32
  "http://vault-specs.herokuapp.com/#{name}"
27
33
  end
@@ -1,5 +1,5 @@
1
1
  module Vault
2
2
  module Test
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
@@ -21,6 +21,7 @@ class SpecHelpersTest < Vault::TestCase
21
21
  File.unlink(STATEMENT_FILE) if File.exists?(STATEMENT_FILE)
22
22
  File.unlink(USAGE_FILE) if File.exists?(USAGE_FILE)
23
23
  reset #for RR
24
+ reset_vault_specs!
24
25
  end
25
26
 
26
27
  # These are for canonical endpoints
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault-test-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -204,7 +204,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  segments:
206
206
  - 0
207
- hash: 1618270359711124284
207
+ hash: 435186238280720439
208
208
  required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  none: false
210
210
  requirements:
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  version: '0'
214
214
  segments:
215
215
  - 0
216
- hash: 1618270359711124284
216
+ hash: 435186238280720439
217
217
  requirements: []
218
218
  rubyforge_project:
219
219
  rubygems_version: 1.8.23