rspec 0.6.4 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +90 -1
- data/EXAMPLES.rd +28 -6
- data/MIT-LICENSE +20 -0
- data/README +18 -12
- data/Rakefile +60 -54
- data/examples/custom_formatter.rb +4 -4
- data/examples/helper_method_example.rb +11 -0
- data/examples/mocking_example.rb +19 -2
- data/examples/partial_mock_example.rb +28 -0
- data/examples/stack_spec.rb +8 -8
- data/examples/stubbing_example.rb +50 -9
- data/examples/test_case_spec.rb +6 -6
- data/lib/spec.rb +1 -2
- data/lib/spec/callback.rb +0 -0
- data/lib/spec/expectations.rb +3 -6
- data/lib/spec/expectations/diff.rb +23 -47
- data/lib/spec/expectations/differs/default.rb +62 -0
- data/lib/spec/expectations/{exceptions.rb → errors.rb} +0 -0
- data/lib/spec/expectations/extensions.rb +4 -0
- data/lib/spec/expectations/extensions/inspect_for_expectation_not_met_error.rb +14 -0
- data/lib/spec/expectations/extensions/numeric.rb +5 -0
- data/lib/spec/expectations/{expectations.rb → extensions/object.rb} +3 -6
- data/lib/spec/expectations/extensions/symbol.rb +5 -0
- data/lib/spec/expectations/should.rb +4 -0
- data/lib/spec/expectations/should/base.rb +42 -0
- data/lib/spec/expectations/should/have.rb +79 -0
- data/lib/spec/expectations/should/not.rb +72 -0
- data/lib/spec/expectations/should/should.rb +83 -0
- data/lib/spec/expectations/sugar.rb +6 -25
- data/lib/spec/mocks.rb +5 -1
- data/lib/spec/mocks/argument_expectation.rb +15 -1
- data/lib/spec/mocks/error_generator.rb +72 -0
- data/lib/spec/mocks/{exceptions.rb → errors.rb} +0 -0
- data/lib/spec/mocks/extensions/object.rb +3 -0
- data/lib/spec/mocks/message_expectation.rb +80 -73
- data/lib/spec/mocks/mock.rb +4 -69
- data/lib/spec/mocks/mock_handler.rb +158 -0
- data/lib/spec/mocks/mock_methods.rb +44 -0
- data/lib/spec/mocks/order_group.rb +10 -2
- data/lib/spec/rake/spectask.rb +20 -18
- data/lib/spec/rake/{rcov_verify.rb → verify_rcov.rb} +2 -2
- data/lib/spec/runner.rb +3 -1
- data/lib/spec/runner/backtrace_tweaker.rb +2 -1
- data/lib/spec/runner/context.rb +10 -16
- data/lib/spec/runner/context_eval.rb +40 -40
- data/lib/spec/runner/execution_context.rb +1 -12
- data/lib/spec/runner/{kernel_ext.rb → extensions/kernel.rb} +2 -2
- data/lib/spec/runner/{instance_exec.rb → extensions/object.rb} +0 -0
- data/lib/spec/runner/formatter/base_text_formatter.rb +25 -18
- data/lib/spec/runner/formatter/html_formatter.rb +81 -101
- data/lib/spec/runner/formatter/progress_bar_formatter.rb +9 -9
- data/lib/spec/runner/formatter/rdoc_formatter.rb +6 -6
- data/lib/spec/runner/formatter/specdoc_formatter.rb +7 -6
- data/lib/spec/runner/option_parser.rb +41 -5
- data/lib/spec/runner/reporter.rb +3 -15
- data/lib/spec/runner/spec_should_raise_handler.rb +74 -0
- data/lib/spec/runner/specification.rb +33 -14
- data/lib/spec/version.rb +6 -3
- data/vendor/watir/README.txt +1 -1
- metadata +34 -68
- data/bin/test2spec +0 -112
- data/examples/helper_method_spec.rb +0 -12
- data/lib/spec/expectations/have_helper.rb +0 -41
- data/lib/spec/expectations/helper.rb +0 -4
- data/lib/spec/expectations/should_base.rb +0 -52
- data/lib/spec/expectations/should_helper.rb +0 -93
- data/lib/spec/expectations/should_negator.rb +0 -71
- data/lib/spec/test_to_spec/ruby2ruby.rb +0 -492
- data/lib/spec/test_to_spec/sexp_transformer.rb +0 -196
- data/lib/spec/test_to_spec/test_case_ext.rb +0 -22
- data/lib/spec/test_to_spec/translation_test_runner.rb +0 -147
- data/test/spec/expectations/arbitrary_operator_test.rb +0 -55
- data/test/spec/expectations/arbitrary_predicate_test.rb +0 -163
- data/test/spec/expectations/containment_test.rb +0 -129
- data/test/spec/expectations/diff_test.rb +0 -62
- data/test/spec/expectations/identity_test.rb +0 -75
- data/test/spec/expectations/object_equality_test.rb +0 -65
- data/test/spec/expectations/raising_test.rb +0 -106
- data/test/spec/expectations/regex_matching_test.rb +0 -36
- data/test/spec/expectations/should_have_test.rb +0 -169
- data/test/spec/expectations/should_satisfy_test.rb +0 -37
- data/test/spec/expectations/sugar_test.rb +0 -93
- data/test/spec/expectations/supported_symbols_test.rb +0 -33
- data/test/spec/expectations/throwing_test.rb +0 -55
- data/test/spec/expectations/true_false_special_case_test.rb +0 -85
- data/test/spec/expectations/typing_test.rb +0 -108
- data/test/spec/mocks/mock_arg_constraints_test.rb +0 -113
- data/test/spec/mocks/mock_counts_test.rb +0 -431
- data/test/spec/mocks/mock_ordering_test.rb +0 -109
- data/test/spec/mocks/mock_test.rb +0 -220
- data/test/spec/mocks/null_object_test.rb +0 -37
- data/test/spec/runner/backtrace_tweaker_test.rb +0 -90
- data/test/spec/runner/context_matching_test.rb +0 -35
- data/test/spec/runner/context_runner_test.rb +0 -62
- data/test/spec/runner/context_test.rb +0 -191
- data/test/spec/runner/execution_context_test.rb +0 -45
- data/test/spec/runner/formatter/failure_dump_test.rb +0 -94
- data/test/spec/runner/formatter/html_formatter_test.rb +0 -48
- data/test/spec/runner/formatter/progress_bar_formatter_test.rb +0 -56
- data/test/spec/runner/formatter/rdoc_formatter_test.rb +0 -51
- data/test/spec/runner/formatter/specdoc_formatter_test.rb +0 -57
- data/test/spec/runner/kernel_ext_test.rb +0 -13
- data/test/spec/runner/option_parser_test.rb +0 -141
- data/test/spec/runner/reporter_test.rb +0 -128
- data/test/spec/runner/spec_matcher_test.rb +0 -47
- data/test/spec/runner/specification_test.rb +0 -121
- data/test/spec/test_to_spec/ruby_to_ruby_test.rb +0 -79
- data/test/spec/test_to_spec/sexp_transformer_assertion_test.rb +0 -207
- data/test/spec/test_to_spec/sexp_transformer_test.rb +0 -303
- data/test/spec/test_to_spec/test_case_ext_test.rb +0 -25
- data/test/spec/test_to_spec/testfiles/test_unit_api_spec.rb +0 -75
- data/test/spec/test_to_spec/testfiles/test_unit_api_test.rb +0 -70
- data/test/test_classes.rb +0 -102
- data/test/test_helper.rb +0 -32
@@ -19,8 +19,8 @@ module Spec
|
|
19
19
|
teardown_parts << block
|
20
20
|
end
|
21
21
|
|
22
|
-
def specify(spec_name, &block)
|
23
|
-
specifications << Specification.new(spec_name, &block)
|
22
|
+
def specify(spec_name, opts={}, &block)
|
23
|
+
specifications << Specification.new(spec_name, opts, &block)
|
24
24
|
end
|
25
25
|
|
26
26
|
def methods
|
@@ -37,6 +37,38 @@ module Spec
|
|
37
37
|
super
|
38
38
|
end
|
39
39
|
|
40
|
+
private
|
41
|
+
def setup_block
|
42
|
+
parts = setup_parts.dup
|
43
|
+
add_context_superclass_method(:setup, parts)
|
44
|
+
create_block_from_parts(parts)
|
45
|
+
end
|
46
|
+
|
47
|
+
def teardown_block
|
48
|
+
parts = teardown_parts.dup
|
49
|
+
add_context_superclass_method(:teardown, parts)
|
50
|
+
create_block_from_parts(parts)
|
51
|
+
end
|
52
|
+
|
53
|
+
def execution_context_class
|
54
|
+
@execution_context_class ||= derive_execution_context_class_from_context_superclass
|
55
|
+
end
|
56
|
+
|
57
|
+
def derive_execution_context_class_from_context_superclass
|
58
|
+
@execution_context_class = Class.new(context_superclass)
|
59
|
+
@execution_context_class.class_eval do
|
60
|
+
include ::Spec::Runner::ExecutionContext::InstanceMethods
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def context_superclass
|
65
|
+
@context_superclass ||= Object
|
66
|
+
end
|
67
|
+
|
68
|
+
def context_modules
|
69
|
+
@context_modules ||= []
|
70
|
+
end
|
71
|
+
|
40
72
|
def specifications
|
41
73
|
@specifications ||= []
|
42
74
|
end
|
@@ -49,28 +81,13 @@ module Spec
|
|
49
81
|
@teardown_parts ||= []
|
50
82
|
end
|
51
83
|
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
setup_method = begin
|
56
|
-
context_superclass.instance_method(:setup)
|
57
|
-
rescue
|
58
|
-
nil
|
59
|
-
end
|
60
|
-
parts.unshift setup_method if setup_method
|
61
|
-
create_block_from_parts(parts)
|
62
|
-
end
|
63
|
-
|
64
|
-
def teardown_block
|
65
|
-
parts = teardown_parts.dup
|
66
|
-
|
67
|
-
teardown_method = begin
|
68
|
-
context_superclass.instance_method(:teardown)
|
84
|
+
def add_context_superclass_method sym, parts
|
85
|
+
superclass_method = begin
|
86
|
+
context_superclass.instance_method(sym)
|
69
87
|
rescue
|
70
88
|
nil
|
71
89
|
end
|
72
|
-
parts.unshift
|
73
|
-
create_block_from_parts(parts)
|
90
|
+
parts.unshift superclass_method if superclass_method
|
74
91
|
end
|
75
92
|
|
76
93
|
def create_block_from_parts(parts)
|
@@ -84,28 +101,11 @@ module Spec
|
|
84
101
|
end
|
85
102
|
end
|
86
103
|
end
|
87
|
-
|
88
|
-
def execution_context_class
|
89
|
-
@execution_context_class ||= derive_execution_context_class_from_context_superclass
|
90
|
-
end
|
91
|
-
|
92
|
-
def derive_execution_context_class_from_context_superclass
|
93
|
-
@execution_context_class = Class.new(context_superclass)
|
94
|
-
@execution_context_class.class_eval do
|
95
|
-
include ::Spec::Runner::ExecutionContext::InstanceMethods
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
def context_superclass
|
100
|
-
@context_superclass ||= Object
|
101
|
-
end
|
102
|
-
|
103
|
-
def context_modules
|
104
|
-
@context_modules ||= []
|
105
|
-
end
|
106
104
|
end
|
105
|
+
|
107
106
|
module InstanceMethods
|
108
107
|
end
|
108
|
+
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
@@ -7,13 +7,7 @@ module Spec
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def mock(name, options={})
|
10
|
-
|
11
|
-
@spec.add_mock(mock)
|
12
|
-
mock
|
13
|
-
end
|
14
|
-
|
15
|
-
def stub(object, name="")
|
16
|
-
stub_space.create_stub(object, name)
|
10
|
+
Spec::Mocks::Mock.new(name, options)
|
17
11
|
end
|
18
12
|
|
19
13
|
def duck_type(*args)
|
@@ -23,11 +17,6 @@ module Spec
|
|
23
17
|
def violated(message="")
|
24
18
|
raise Spec::Expectations::ExpectationNotMetError.new(message)
|
25
19
|
end
|
26
|
-
|
27
|
-
private
|
28
|
-
def stub_space
|
29
|
-
@spec.stub_space
|
30
|
-
end
|
31
20
|
end
|
32
21
|
include InstanceMethods
|
33
22
|
end
|
@@ -3,12 +3,12 @@ module Kernel
|
|
3
3
|
context = Spec::Runner::Context.new(name, &block)
|
4
4
|
runner = context_runner
|
5
5
|
runner.add_context(context)
|
6
|
-
runner.run(false) if runner.standalone
|
7
6
|
end
|
8
7
|
|
9
8
|
private
|
10
9
|
|
11
10
|
def context_runner
|
12
|
-
$context_runner
|
11
|
+
if $context_runner.nil?; $context_runner = ::Spec::Runner::OptionParser.create_context_runner(ARGV.dup, true, STDERR, STDOUT); at_exit { $context_runner.run(false) }; end
|
12
|
+
$context_runner
|
13
13
|
end
|
14
14
|
end
|
File without changes
|
@@ -9,11 +9,7 @@ module Spec
|
|
9
9
|
@output = output
|
10
10
|
@dry_run = dry_run
|
11
11
|
@colour = colour
|
12
|
-
begin
|
13
|
-
require 'Win32/Console/ANSI' if @colour && PLATFORM =~ /win32/
|
14
|
-
rescue LoadError
|
15
|
-
raise "You must gem install win32console to use --color on Windows"
|
16
|
-
end
|
12
|
+
begin ; require 'Win32/Console/ANSI' if @colour && PLATFORM =~ /win32/ ; rescue LoadError ; raise "You must gem install win32console to use colour on Windows" ; end
|
17
13
|
end
|
18
14
|
|
19
15
|
# This method is invoked before any specs are run, right after
|
@@ -64,28 +60,39 @@ module Spec
|
|
64
60
|
@output.puts
|
65
61
|
@output.puts "#{counter.to_s})"
|
66
62
|
@output.puts failure.header
|
67
|
-
@output.puts failure.message
|
68
|
-
@output.puts failure.backtrace
|
69
|
-
|
63
|
+
@output.puts failure.exception.message
|
64
|
+
@output.puts failure.exception.backtrace.join("\n")
|
65
|
+
STDOUT.flush
|
70
66
|
end
|
71
67
|
|
72
68
|
# This method is invoked at the very end.
|
73
69
|
def dump_summary(duration, spec_count, failure_count)
|
74
70
|
return if @dry_run
|
75
|
-
if @colour && @output == STDOUT
|
76
|
-
colour_prefix = (failure_count == 0 ? "\e[32m" : "\e[31m")
|
77
|
-
colour_postfix = "\e[0m"
|
78
|
-
summary_output = Kernel
|
79
|
-
else
|
80
|
-
colour_prefix = colour_postfix = ""
|
81
|
-
summary_output = @output
|
82
|
-
end
|
83
71
|
@output.puts
|
84
72
|
@output.puts "Finished in #{duration} seconds"
|
85
73
|
@output.puts
|
86
|
-
|
87
|
-
|
74
|
+
summary = "#{spec_count} specification#{'s' unless spec_count == 1}, #{failure_count} failure#{'s' unless failure_count == 1}"
|
75
|
+
if failure_count == 0
|
76
|
+
@output.puts green(summary)
|
77
|
+
else
|
78
|
+
@output.puts red(summary)
|
79
|
+
end
|
88
80
|
end
|
81
|
+
|
82
|
+
protected
|
83
|
+
|
84
|
+
def colour(text, colour_code)
|
85
|
+
return text unless @colour && @output == Kernel
|
86
|
+
"#{colour_code}#{text}\e[0m"
|
87
|
+
end
|
88
|
+
|
89
|
+
def red(text); colour(text, "\e[31m"); end
|
90
|
+
def green(text); colour(text, "\e[32m"); end
|
91
|
+
|
92
|
+
def format_backtrace(backtrace)
|
93
|
+
backtrace.nil? ? "" : backtrace.join("\n")
|
94
|
+
end
|
95
|
+
|
89
96
|
end
|
90
97
|
end
|
91
98
|
end
|
@@ -11,7 +11,7 @@ module Spec
|
|
11
11
|
@spec_count = spec_count
|
12
12
|
|
13
13
|
@output.puts HEADER
|
14
|
-
|
14
|
+
STDOUT.flush
|
15
15
|
end
|
16
16
|
|
17
17
|
def add_context(name, first)
|
@@ -20,14 +20,14 @@ module Spec
|
|
20
20
|
@output.puts "</div>"
|
21
21
|
end
|
22
22
|
@output.puts "<div class=\"context\">"
|
23
|
-
@output.puts " <
|
23
|
+
@output.puts " <h2>#{name}</h2>"
|
24
24
|
@output.puts " <ul>"
|
25
25
|
end
|
26
26
|
|
27
27
|
def start_dump
|
28
28
|
@output.puts " </ul>"
|
29
29
|
@output.puts "</div>"
|
30
|
-
|
30
|
+
STDOUT.flush
|
31
31
|
end
|
32
32
|
|
33
33
|
def spec_started(name)
|
@@ -36,120 +36,100 @@ module Spec
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def spec_passed(name)
|
39
|
-
@output.puts "<li class=\"spec passed\">#{escape(@current_spec)}</li>"
|
39
|
+
@output.puts "<li class=\"spec passed\"><div class=\"name\">#{escape(@current_spec)}</div></li>"
|
40
40
|
end
|
41
41
|
|
42
42
|
def spec_failed(name, counter, failure)
|
43
|
-
@output.puts "<li class=\"spec failed\"
|
44
|
-
@output.puts " <div>#{escape(@current_spec)}</div>"
|
45
|
-
@output.puts " <div class=\"failure\" id=\"failure_#{counter}\"
|
46
|
-
@output.puts " <div><pre>#{escape(failure.
|
47
|
-
@output.puts " <div><pre>#{
|
48
|
-
@output.puts " <div><pre>#{escape(failure.backtrace)}</pre></div>" unless failure.backtrace == ""
|
43
|
+
@output.puts "<li class=\"spec failed\">"
|
44
|
+
@output.puts " <div class=\"name\">#{escape(@current_spec)}</div>"
|
45
|
+
@output.puts " <div class=\"failure\" id=\"failure_#{counter}\">"
|
46
|
+
@output.puts " <div class=\"message\"><pre>#{escape(failure.exception.message)}</pre></div>" unless failure.exception.nil?
|
47
|
+
@output.puts " <div class=\"backtrace\"><pre>#{format_backtrace(failure.exception.backtrace)}</pre></div>" unless failure.exception.nil?
|
49
48
|
@output.puts " </div>"
|
50
49
|
@output.puts "</li>"
|
51
|
-
|
50
|
+
STDOUT.flush
|
52
51
|
end
|
53
|
-
|
52
|
+
|
54
53
|
def escape(string)
|
55
54
|
string.gsub(/&/n, '&').gsub(/\"/n, '"').gsub(/>/n, '>').gsub(/</n, '<')
|
56
55
|
end
|
57
56
|
|
58
57
|
def dump_failure(counter, failure)
|
59
|
-
# @output << "\n"
|
60
|
-
# @output << counter.to_s << ")\n"
|
61
|
-
# @output << "#{failure.header}\n"
|
62
|
-
# @output << "#{failure.message}\n"
|
63
|
-
# @output << "#{failure.backtrace}\n"
|
64
|
-
# @output.flush
|
65
58
|
end
|
66
59
|
|
67
60
|
def dump_summary(duration, spec_count, failure_count)
|
68
|
-
@output
|
69
|
-
@output
|
70
|
-
|
61
|
+
@output.print "</body>"
|
62
|
+
@output.print "</html>"
|
63
|
+
STDOUT.flush
|
71
64
|
end
|
72
|
-
|
65
|
+
|
73
66
|
HEADER = <<-HEADER
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
elemStyle.display = "block"
|
141
|
-
} else {
|
142
|
-
elemStyle.display = "none"
|
143
|
-
}
|
144
|
-
|
145
|
-
return true;
|
146
|
-
}
|
147
|
-
// ]]>
|
148
|
-
</script>
|
149
|
-
|
150
|
-
</head>
|
151
|
-
<body>
|
152
|
-
HEADER
|
67
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
68
|
+
<!DOCTYPE html
|
69
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
70
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
71
|
+
|
72
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
73
|
+
<head>
|
74
|
+
<title>RSpec results</title>
|
75
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
76
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
77
|
+
<style type="text/css">
|
78
|
+
body {
|
79
|
+
font-size: 10pt;
|
80
|
+
font: "lucida grande";
|
81
|
+
width: 85%;
|
82
|
+
}
|
83
|
+
|
84
|
+
h2 {
|
85
|
+
color: #589CCF;
|
86
|
+
}
|
87
|
+
|
88
|
+
div.context {
|
89
|
+
padding: 0px;
|
90
|
+
background: #fff;
|
91
|
+
margin-top: 0px;
|
92
|
+
}
|
93
|
+
|
94
|
+
ul {
|
95
|
+
padding-left: 0px;
|
96
|
+
}
|
97
|
+
|
98
|
+
li {
|
99
|
+
list-style-type: none;
|
100
|
+
margin: 0;
|
101
|
+
border: 2px solid #fff;
|
102
|
+
}
|
103
|
+
|
104
|
+
li.passed {
|
105
|
+
display: block;
|
106
|
+
background: #46A002;
|
107
|
+
color: #fff;
|
108
|
+
padding: 2px 4px;
|
109
|
+
font-weight: bold
|
110
|
+
}
|
111
|
+
|
112
|
+
li.failed {
|
113
|
+
display: block;
|
114
|
+
background: red;
|
115
|
+
color: #fff;
|
116
|
+
padding: 2px 4px;
|
117
|
+
font-weight: bold
|
118
|
+
}
|
119
|
+
|
120
|
+
li.failed .failure {
|
121
|
+
font-weight: normal;
|
122
|
+
font-size: 9pt;
|
123
|
+
}
|
124
|
+
|
125
|
+
div.backtrace {
|
126
|
+
color: #000;
|
127
|
+
}
|
128
|
+
|
129
|
+
</style>
|
130
|
+
</head>
|
131
|
+
<body>
|
132
|
+
HEADER
|
153
133
|
end
|
154
134
|
end
|
155
135
|
end
|
@@ -3,23 +3,23 @@ module Spec
|
|
3
3
|
module Formatter
|
4
4
|
class ProgressBarFormatter < BaseTextFormatter
|
5
5
|
def add_context(name, first)
|
6
|
-
@output
|
7
|
-
|
6
|
+
@output.puts if first
|
7
|
+
STDOUT.flush
|
8
8
|
end
|
9
9
|
|
10
10
|
def spec_failed(name, counter, failure)
|
11
|
-
@output
|
12
|
-
|
11
|
+
@output.print red('F')
|
12
|
+
STDOUT.flush
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
def spec_passed(name)
|
16
|
-
@output
|
17
|
-
|
16
|
+
@output.print green('.')
|
17
|
+
STDOUT.flush
|
18
18
|
end
|
19
19
|
|
20
20
|
def start_dump
|
21
|
-
@output
|
22
|
-
|
21
|
+
@output.puts
|
22
|
+
STDOUT.flush
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|