Module: Vault::Test::SpecHelpers
Instance Method Summary collapse
- #reset_vault_specs! ⇒ Object
- #statement_json ⇒ Object
- #usage_json ⇒ Object
-
#vault_spec(filename) ⇒ Object
Memoizes return value so we don’t keep making a request to download the spec.
Instance Method Details
#reset_vault_specs! ⇒ Object
23 24 25 |
# File 'lib/vault-test-tools/spec_helpers.rb', line 23 def reset_vault_specs! @@cache = {} end |
#statement_json ⇒ Object
12 13 14 |
# File 'lib/vault-test-tools/spec_helpers.rb', line 12 def statement_json vault_spec('statement.json') end |
#usage_json ⇒ Object
8 9 10 |
# File 'lib/vault-test-tools/spec_helpers.rb', line 8 def usage_json vault_spec('usage.json') end |
#vault_spec(filename) ⇒ Object
Memoizes return value so we don’t keep making a request to download the spec.
18 19 20 21 |
# File 'lib/vault-test-tools/spec_helpers.rb', line 18 def vault_spec(filename) return cache[filename] if cache[filename] cache[filename] = read_spec(filename) end |