vault-test-tools 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,19 @@
1
1
  require 'scrolls'
2
+ require 'logfmt'
2
3
 
3
4
  module Vault::Test::LoggingHelpers
4
5
  def setup
5
6
  super
6
7
  Scrolls.stream = StringIO.new if defined? Scrolls
8
+ @last_logline = nil
9
+ @last_logdata = nil
10
+ end
11
+
12
+ def logline
13
+ @last_logline ||= Scrolls.stream.string
14
+ end
15
+
16
+ def logdata
17
+ @last_logdata ||= Logfmt.parse(logline)
7
18
  end
8
19
  end
@@ -1,5 +1,5 @@
1
1
  module Vault
2
2
  module Test
3
- VERSION = '0.3.6'
3
+ VERSION = '0.3.7'
4
4
  end
5
5
  end
@@ -9,4 +9,14 @@ class LoggingHelpersTest < Vault::TestCase
9
9
  Scrolls.log(key: 'value')
10
10
  assert_equal("key=value", Scrolls.stream.string.strip)
11
11
  end
12
+
13
+ def test_logline
14
+ Scrolls.log(foo: 'bar')
15
+ assert_includes(logline, 'foo=bar')
16
+ end
17
+
18
+ def test_logdata
19
+ Scrolls.log(foo: 'baz')
20
+ assert_equal('baz', logdata[:foo])
21
+ end
12
22
  end
@@ -2,7 +2,6 @@ require 'helper'
2
2
 
3
3
  class SpecHelpersTest < Vault::TestCase
4
4
  include Vault::Test::SpecHelpers
5
- include RR::Adapters::MiniTest
6
5
  STATEMENT_FILE = './test/support/statement.json'
7
6
  USAGE_FILE = './test/support/usage.json'
8
7
 
@@ -23,4 +23,5 @@ Gem::Specification.new do |gem|
23
23
  gem.add_dependency 'rack-test'
24
24
  gem.add_dependency 'rr'
25
25
  gem.add_dependency 'guard-minitest'
26
+ gem.add_dependency 'logfmt'
26
27
  end
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.6
4
+ version: 0.3.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-27 00:00:00.000000000 Z
13
+ date: 2014-02-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest
@@ -108,6 +108,22 @@ dependencies:
108
108
  - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: logfmt
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
111
127
  description: Basic tools for Heroku Vault's Ruby projects
112
128
  email:
113
129
  - chriscontinanza@gmail.com
@@ -156,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
172
  version: '0'
157
173
  segments:
158
174
  - 0
159
- hash: -866983626010758592
175
+ hash: -3961058099803504560
160
176
  required_rubygems_version: !ruby/object:Gem::Requirement
161
177
  none: false
162
178
  requirements:
@@ -165,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
181
  version: '0'
166
182
  segments:
167
183
  - 0
168
- hash: -866983626010758592
184
+ hash: -3961058099803504560
169
185
  requirements: []
170
186
  rubyforge_project:
171
187
  rubygems_version: 1.8.23