pliny 0.17.0 → 0.17.1

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: 9a23d5c9332e98aa75fbe6d56ec858314aeafe88
4
- data.tar.gz: 832352cd2b15849d452783fa87638b4d8fc7fa68
3
+ metadata.gz: 56651d8e3b670e7954a475c9d8cb04cc0124099f
4
+ data.tar.gz: ad7701bdf942d068994be11da8b3ceb7bc231082
5
5
  SHA512:
6
- metadata.gz: caef1b86bf0355f08804ff6d771dc3fb93f8520fc77332a5dd1dd25aad319d70802356198772a12cc70191f0118a6bf1747c50f0dd0362f958b2ff674e828260
7
- data.tar.gz: 4253d293b4fac10cdd17d4291ffb77e44fa11c7fd5e31ada8caa0ce15997a7825eb86ad2b779e8658d7ee7e195cb47c5693fc72859dde4f79c3daa8ee2019ea0
6
+ metadata.gz: d73cbdd0b3dcde8423dc2743af931738bc41a5d608281a031f29a160ac9cee73d8e40a7dac34274e0b619e9b695487c464286efcd412c20e79f8e61f4b03d09d
7
+ data.tar.gz: cf7bc5313022abc17ebee414f53ad004d66cd3177bee895daf8b7ba755451ee93602f41a0b128c9b1f9658cdeda1bebbf291a67a8ed2f424f8867246421978e0
data/lib/pliny/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pliny
2
- VERSION = "0.17.0"
2
+ VERSION = "0.17.1"
3
3
  end
@@ -9,9 +9,7 @@ describe Pliny::Commands::Generator do
9
9
  before do
10
10
  Timecop.freeze(@t = Time.now)
11
11
 
12
- any_instance_of(Pliny::Commands::Generator::Base) do |klass|
13
- stub(klass).display
14
- end
12
+ allow_any_instance_of(Pliny::Commands::Generator::Base).to receive(:display)
15
13
  end
16
14
 
17
15
  around do |example|
@@ -6,7 +6,7 @@ describe Pliny::Commands::Updater do
6
6
  @io = StringIO.new
7
7
  @cmd = Pliny::Commands::Updater.new(@io)
8
8
 
9
- stub(@cmd).exec_patch
9
+ allow(@cmd).to receive(:exec_patch)
10
10
  end
11
11
 
12
12
  describe "#run!" do
@@ -14,9 +14,9 @@ describe Pliny::ErrorReporter do
14
14
  end
15
15
 
16
16
  it "notifies rollbar" do
17
- any_instance_of(Pliny::ErrorReporter::RollbarReporter) do |klass|
18
- stub(klass).notify(exception, context: context, rack_env: rack_env)
19
- end
17
+ expect_any_instance_of(Pliny::ErrorReporter::RollbarReporter).
18
+ to receive(:notify).
19
+ with(exception, context: context, rack_env: rack_env)
20
20
 
21
21
  notify_reporter
22
22
  end
@@ -11,7 +11,7 @@ describe Pliny::Helpers::Encode do
11
11
  end
12
12
 
13
13
  before do
14
- stub(Config).pretty_json { false }
14
+ allow(Config).to receive(:pretty_json) { false }
15
15
  end
16
16
 
17
17
  it "sets the Content-Type" do
@@ -33,7 +33,7 @@ describe Pliny::Helpers::Encode do
33
33
  end
34
34
 
35
35
  it "encodes in pretty mode when set by config" do
36
- stub(Config).pretty_json { true }
36
+ allow(Config).to receive(:pretty_json) { true }
37
37
  payload = { "foo" => "bar" }
38
38
  post "/", payload
39
39
  assert_equal MultiJson.encode(payload, pretty: true), last_response.body
data/spec/log_spec.rb CHANGED
@@ -5,7 +5,7 @@ describe Pliny::Log do
5
5
  @io = StringIO.new
6
6
  Pliny.stdout = @io
7
7
  Pliny.stderr = @io
8
- stub(@io).print
8
+ allow(@io).to receive(:print)
9
9
  end
10
10
 
11
11
  after do
@@ -13,7 +13,7 @@ describe Pliny::Log do
13
13
  end
14
14
 
15
15
  it "logs in structured format" do
16
- mock(@io).print "foo=bar baz=42\n"
16
+ expect(@io).to receive(:print).with("foo=bar baz=42\n")
17
17
  Pliny.log(foo: "bar", baz: 42)
18
18
  end
19
19
 
@@ -26,26 +26,26 @@ describe Pliny::Log do
26
26
  end
27
27
 
28
28
  it "supports blocks to log stages and elapsed" do
29
- mock(@io).print "foo=bar at=start\n"
30
- mock(@io).print "foo=bar at=finish elapsed=0.000\n"
29
+ expect(@io).to receive(:print).with("foo=bar at=start\n")
30
+ expect(@io).to receive(:print).with("foo=bar at=finish elapsed=0.000\n")
31
31
  Pliny.log(foo: "bar") do
32
32
  end
33
33
  end
34
34
 
35
35
  it "merges default context" do
36
36
  Pliny.default_context = { app: "pliny" }
37
- mock(@io).print "app=pliny foo=bar\n"
37
+ expect(@io).to receive(:print).with("app=pliny foo=bar\n")
38
38
  Pliny.log(foo: "bar")
39
39
  end
40
40
 
41
41
  it "merges context from RequestStore" do
42
42
  Pliny::RequestStore.store[:log_context] = { app: "pliny" }
43
- mock(@io).print "app=pliny foo=bar\n"
43
+ expect(@io).to receive(:print).with("app=pliny foo=bar\n")
44
44
  Pliny.log(foo: "bar")
45
45
  end
46
46
 
47
47
  it "supports a context" do
48
- mock(@io).print "app=pliny foo=bar\n"
48
+ expect(@io).to receive(:print).with("app=pliny foo=bar\n")
49
49
  Pliny.context(app: "pliny") do
50
50
  Pliny.log(foo: "bar")
51
51
  end
@@ -53,14 +53,14 @@ describe Pliny::Log do
53
53
 
54
54
  it "local context does not overwrite default context" do
55
55
  Pliny.default_context = { app: "pliny" }
56
- mock(@io).print "app=not_pliny foo=bar\n"
56
+ expect(@io).to receive(:print).with("app=not_pliny foo=bar\n")
57
57
  Pliny.log(app: 'not_pliny', foo: "bar")
58
58
  assert Pliny.default_context[:app] == "pliny"
59
59
  end
60
60
 
61
61
  it "local context does not overwrite request context" do
62
62
  Pliny::RequestStore.store[:log_context] = { app: "pliny" }
63
- mock(@io).print "app=not_pliny foo=bar\n"
63
+ expect(@io).to receive(:print).with("app=not_pliny foo=bar\n")
64
64
  Pliny.context(app: "not_pliny") do
65
65
  Pliny.log(foo: "bar")
66
66
  end
@@ -69,7 +69,7 @@ describe Pliny::Log do
69
69
 
70
70
  it "local context does not propagate outside" do
71
71
  Pliny::RequestStore.store[:log_context] = { app: "pliny" }
72
- mock(@io).print "app=pliny foo=bar\n"
72
+ expect(@io).to receive(:print).with("app=pliny foo=bar\n")
73
73
  Pliny.context(app: "not_pliny", test: 123) do
74
74
  end
75
75
  Pliny.log(foo: "bar")
@@ -78,7 +78,7 @@ describe Pliny::Log do
78
78
  it "logs exceptions" do
79
79
  Pliny::RequestStore.store[:log_context] = { app: "pliny" }
80
80
  e = RuntimeError.new
81
- mock(@io).print "app=pliny exception class=RuntimeError message=RuntimeError exception_id=#{e.object_id}\n"
81
+ expect(@io).to receive(:print).with("app=pliny exception class=RuntimeError message=RuntimeError exception_id=#{e.object_id}\n")
82
82
  Pliny.log_exception(e)
83
83
  end
84
84
  end
@@ -23,13 +23,13 @@ describe Pliny::Middleware::Instruments do
23
23
  end
24
24
 
25
25
  it "performs logging" do
26
- mock(Pliny).log(hash_including(
26
+ expect(Pliny).to receive(:log).with(hash_including(
27
27
  instrumentation: true,
28
28
  at: "start",
29
29
  method: "GET",
30
30
  path: "/apps/123",
31
31
  ))
32
- mock(Pliny).log(hash_including(
32
+ expect(Pliny).to receive(:log).with(hash_including(
33
33
  instrumentation: true,
34
34
  at: "finish",
35
35
  method: "GET",
@@ -41,8 +41,8 @@ describe Pliny::Middleware::Instruments do
41
41
  end
42
42
 
43
43
  it "respects Pliny error status codes" do
44
- mock(Pliny).log.with_any_args
45
- mock(Pliny).log(hash_including(
44
+ expect(Pliny).to receive(:log)
45
+ expect(Pliny).to receive(:log).with(hash_including(
46
46
  status: 404
47
47
  ))
48
48
  get "/error"
@@ -14,12 +14,12 @@ describe Pliny::Middleware::RequestStore do
14
14
  end
15
15
 
16
16
  it "clears the store" do
17
- mock(Pliny::RequestStore).clear!
17
+ expect(Pliny::RequestStore).to receive(:clear!)
18
18
  get "/"
19
19
  end
20
20
 
21
21
  it "seeds the store" do
22
- mock(Pliny::RequestStore).seed.with_any_args
22
+ expect(Pliny::RequestStore).to receive(:seed)
23
23
  get "/"
24
24
  end
25
25
  end
@@ -28,7 +28,7 @@ describe Pliny::Middleware::RescueErrors do
28
28
 
29
29
  it "intercepts exceptions and renders" do
30
30
  @app = new_rack_app
31
- mock(Pliny::ErrorReporter).notify.with_any_args
31
+ expect(Pliny::ErrorReporter).to receive(:notify)
32
32
  get "/"
33
33
  assert_equal 500, last_response.status
34
34
  error_json = MultiJson.decode(last_response.body)
@@ -5,7 +5,6 @@ describe Pliny::Middleware::Versioning do
5
5
  before do
6
6
  @io = StringIO.new
7
7
  Pliny.stdout = @io
8
- stub(@io).print
9
8
  end
10
9
 
11
10
  def app
@@ -7,7 +7,7 @@ describe Pliny::RollbarLogger do
7
7
  let(:log_context) { { rollbar: true, level: level, message: message } }
8
8
 
9
9
  before do
10
- mock(Pliny).log(log_context)
10
+ expect(Pliny).to receive(:log).with(log_context)
11
11
  end
12
12
 
13
13
  context '#debug' do
data/spec/spec_helper.rb CHANGED
@@ -22,7 +22,7 @@ RSpec.configure do |config|
22
22
  config.include Rack::Test::Methods
23
23
 
24
24
  config.expect_with :minitest
25
- config.mock_with :rr
25
+ config.mock_with :rspec
26
26
  config.run_all_when_everything_filtered = true
27
27
  config.filter_run :focus
28
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pliny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandur Leach
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-25 00:00:00.000000000 Z
12
+ date: 2016-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -191,26 +191,6 @@ dependencies:
191
191
  - - ">="
192
192
  - !ruby/object:Gem::Version
193
193
  version: 0.6.2
194
- - !ruby/object:Gem::Dependency
195
- name: rr
196
- requirement: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - "~>"
199
- - !ruby/object:Gem::Version
200
- version: '1.1'
201
- - - ">="
202
- - !ruby/object:Gem::Version
203
- version: 1.1.2
204
- type: :development
205
- prerelease: false
206
- version_requirements: !ruby/object:Gem::Requirement
207
- requirements:
208
- - - "~>"
209
- - !ruby/object:Gem::Version
210
- version: '1.1'
211
- - - ">="
212
- - !ruby/object:Gem::Version
213
- version: 1.1.2
214
194
  - !ruby/object:Gem::Dependency
215
195
  name: rspec
216
196
  requirement: !ruby/object:Gem::Requirement