steno 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/steno-prettify CHANGED
@@ -15,7 +15,7 @@ def prettify_io(io, prettifier, ignore_parse_error = false)
15
15
 
16
16
  io.each_line do |line|
17
17
  begin
18
- match_data = line.match(json_regex)
18
+ match_data = line.match(json_regex) || []
19
19
  prefix = match_data[1]
20
20
  json = match_data[2]
21
21
 
data/lib/steno/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steno
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -88,7 +88,8 @@ describe Steno::Config do
88
88
  end
89
89
 
90
90
  it "should read the 'level' key if both default_log_level and level are spscified" do
91
- write_config(@config_path, { "level" => "debug2", "default_log_level" => "warn" })
91
+ write_config(@config_path, { "level" => "debug2",
92
+ "default_log_level" => "warn" })
92
93
  Steno::Config.from_file(@config_path).default_log_level.should == :debug2
93
94
  end
94
95
 
@@ -63,9 +63,9 @@ describe Steno::Sink::IO do
63
63
 
64
64
  io.should_receive(:write).with(record.message).ordered.and_raise(IOError)
65
65
 
66
- expect {
66
+ expect do
67
67
  Steno::Sink::IO.new(io, :codec => codec).add_record(record)
68
- }.to raise_error(IOError)
68
+ end.to raise_error(IOError)
69
69
  end
70
70
 
71
71
  it "should retry not more than specified number of times on IOError" do
@@ -74,13 +74,29 @@ describe Steno::Sink::IO do
74
74
 
75
75
  io = mock("io")
76
76
 
77
- io.should_receive(:write).exactly(3).times.with(record.message).ordered.
77
+ io.should_receive(:write).exactly(3).times.with(record.message).
78
78
  and_raise(IOError)
79
79
 
80
- expect {
80
+ expect do
81
81
  Steno::Sink::IO.new(io, :codec => codec, :max_retries => 2).
82
82
  add_record(record)
83
- }.to raise_error(IOError)
83
+ end.to raise_error(IOError)
84
+ end
85
+
86
+ it "should retry on IOError and succeed" do
87
+ codec = mock("codec")
88
+ codec.should_receive(:encode_record).with(record).and_return(record.message)
89
+
90
+ io = mock("io")
91
+ io.should_receive(:write).with(record.message).once.
92
+ and_raise(IOError)
93
+ io.should_receive(:write).with(record.message).once.ordered.
94
+ and_return(record.message)
95
+
96
+ expect do
97
+ Steno::Sink::IO.new(io, :codec => codec, :max_retries => 1).
98
+ add_record(record)
99
+ end.to_not raise_error(IOError)
84
100
  end
85
101
  end
86
102
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-12 00:00:00.000000000 Z
12
+ date: 2012-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: grape