rspec_log_formatter 0.2.0 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ec13df1f1c0b2c7a1405b9030e401d587913eba
|
4
|
+
data.tar.gz: 446675cd9c5b640c9bca6b351ee8b658cdc3be4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8daad0901a9318e5a7ebcfb63da743deb2cd9d4ef9fcdc00301df22c00e99ba456f19cd2244dc6d8ff492c0a6610ae7f41c51b89e6f589f89d8f44af60f5f3f7
|
7
|
+
data.tar.gz: 9de5fe58628f2f2c5ee1221bf95f59f145042f518177cdb24f328a8e7cb087886cca25f730327fd44dccd9b10fba11d61222cfa510f51a30aad5d790a27d80c4
|
@@ -2,7 +2,7 @@ require "csv"
|
|
2
2
|
require "rspec/core/formatters/base_formatter"
|
3
3
|
|
4
4
|
module RspecLogFormatter
|
5
|
-
class AnalyzerFormatter
|
5
|
+
class AnalyzerFormatter < RSpec::Core::Formatters::BaseFormatter
|
6
6
|
FILENAME = "rspec.history"
|
7
7
|
|
8
8
|
class Factory
|
@@ -10,7 +10,7 @@ module RspecLogFormatter
|
|
10
10
|
@options = options
|
11
11
|
end
|
12
12
|
|
13
|
-
def build(output)
|
13
|
+
def build(output=$stdout)
|
14
14
|
RspecLogFormatter::AnalyzerFormatter.new(output, {
|
15
15
|
builds_to_analyze: nil,
|
16
16
|
max_reruns: nil
|
@@ -19,6 +19,7 @@ module RspecLogFormatter
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def initialize(output, options={})
|
22
|
+
super(output)
|
22
23
|
@output = output
|
23
24
|
@options = options
|
24
25
|
end
|
@@ -2,7 +2,7 @@ require "csv"
|
|
2
2
|
require "rspec/core/formatters/base_formatter"
|
3
3
|
|
4
4
|
module RspecLogFormatter
|
5
|
-
class Formatter
|
5
|
+
class Formatter < RSpec::Core::Formatters::BaseFormatter
|
6
6
|
|
7
7
|
class Factory
|
8
8
|
def initialize(options={})
|
@@ -10,15 +10,18 @@ module RspecLogFormatter
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def build
|
13
|
-
|
13
|
+
opts = {
|
14
14
|
clock: Time,
|
15
15
|
build_number: ENV["BUILD_NUMBER"],
|
16
|
-
limit_history: nil
|
17
|
-
|
16
|
+
limit_history: nil,
|
17
|
+
output: $stdout
|
18
|
+
}.merge(@options)
|
19
|
+
RspecLogFormatter::Formatter.new(opts[:output], opts)
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
21
|
-
def initialize(opts={})
|
23
|
+
def initialize(output, opts={})
|
24
|
+
super(output)
|
22
25
|
@clock = opts[:clock]
|
23
26
|
@build_number = opts[:build_number]
|
24
27
|
@limit_history = opts[:limit_history]
|
@@ -9,7 +9,7 @@ describe RspecLogFormatter::Formatter do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def formatter_for_build(build, opts={})
|
12
|
-
RspecLogFormatter::Formatter.new({clock: double(now: Time.at(0)), build_number: build}.merge(opts))
|
12
|
+
RspecLogFormatter::Formatter.new(nil, {clock: double(now: Time.at(0)), build_number: build}.merge(opts))
|
13
13
|
end
|
14
14
|
|
15
15
|
it "can truncate the log file" do
|
@@ -57,7 +57,7 @@ HEREDOC
|
|
57
57
|
passed_example = make_example(2, exception: nil)
|
58
58
|
time = Time.parse("2014-02-06 16:01:10")
|
59
59
|
clock = FakeClock.new(time)
|
60
|
-
formatter = RspecLogFormatter::Formatter.new(clock: clock)
|
60
|
+
formatter = RspecLogFormatter::Formatter.new(nil, clock: clock)
|
61
61
|
formatter.example_started(failed_example)
|
62
62
|
clock.now = time + 5
|
63
63
|
formatter.example_failed(failed_example)
|