steno 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/steno-prettify +1 -1
- data/lib/steno/version.rb +1 -1
- data/spec/unit/config_spec.rb +2 -1
- data/spec/unit/sink/io_spec.rb +21 -5
- metadata +2 -2
data/bin/steno-prettify
CHANGED
data/lib/steno/version.rb
CHANGED
data/spec/unit/config_spec.rb
CHANGED
@@ -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",
|
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
|
|
data/spec/unit/sink/io_spec.rb
CHANGED
@@ -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
|
-
|
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).
|
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
|
-
|
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.
|
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
|
+
date: 2012-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: grape
|