dchelimsky-rspec 1.1.12 → 1.1.99.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/History.txt +35 -0
- data/License.txt +1 -1
- data/Manifest.txt +22 -73
- data/README.txt +2 -2
- data/Rakefile +32 -7
- data/TODO.txt +9 -4
- data/bin/spec +1 -1
- data/cucumber.yml +2 -0
- data/examples/failing/spec_helper.rb +1 -1
- data/examples/passing/filtered_formatter.rb +18 -0
- data/examples/passing/filtered_formatter_example.rb +31 -0
- data/examples/passing/spec_helper.rb +1 -1
- data/examples/ruby1.9.compatibility/access_to_constants_spec.rb +17 -18
- data/features/before_and_after_blocks/before_and_after_blocks.feature +4 -4
- data/features/example_groups/autogenerated_docstrings.feature +2 -2
- data/features/example_groups/example_group_with_should_methods.feature +1 -1
- data/features/example_groups/nested_groups.feature +1 -1
- data/features/interop/examples_and_tests_together.feature +1 -1
- data/features/interop/test_but_not_test_unit.feature +1 -1
- data/features/interop/test_case_with_should_methods.feature +1 -1
- data/features/mock_framework_integration/use_flexmock.feature +22 -4
- data/features/mock_framework_integration/use_mocha.feature +27 -0
- data/features/mock_framework_integration/use_rr.feature +27 -0
- data/features/step_definitions/running_rspec.rb +5 -3
- data/features/support/env.rb +1 -1
- data/features-pending/cli/conditional_exclusion.feature +39 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/flexmock.rb +1 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/mocha.rb +1 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/rr.rb +1 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/rspec.rb +0 -1
- data/lib/spec/autorun.rb +3 -0
- data/lib/spec/example/before_and_after_hooks.rb +5 -20
- data/lib/spec/example/example_description.rb +15 -0
- data/lib/spec/example/example_group.rb +0 -15
- data/lib/spec/example/example_group_factory.rb +34 -46
- data/lib/spec/example/example_group_hierarchy.rb +53 -0
- data/lib/spec/example/example_group_methods.rb +96 -211
- data/lib/spec/example/example_methods.rb +62 -81
- data/lib/spec/example/module_reopening_fix.rb +23 -1
- data/lib/spec/example/predicate_matchers.rb +47 -0
- data/lib/spec/example/subject.rb +91 -0
- data/lib/spec/example.rb +4 -0
- data/lib/spec/expectations/extensions.rb +0 -1
- data/lib/spec/expectations/handler.rb +6 -1
- data/lib/spec/expectations.rb +1 -1
- data/lib/spec/interop/test/unit/testcase.rb +5 -22
- data/lib/spec/interop/test.rb +1 -0
- data/lib/spec/matchers/be.rb +2 -7
- data/lib/spec/matchers/be_close.rb +20 -5
- data/lib/spec/matchers/change.rb +5 -3
- data/lib/spec/matchers/eql.rb +24 -6
- data/lib/spec/matchers/equal.rb +24 -6
- data/lib/spec/matchers/exist.rb +21 -5
- data/lib/spec/matchers/generated_descriptions.rb +2 -2
- data/lib/spec/matchers/has.rb +28 -11
- data/lib/spec/matchers/match.rb +25 -7
- data/lib/spec/matchers/match_array.rb +1 -1
- data/lib/spec/matchers/method_missing.rb +2 -2
- data/lib/spec/matchers/operator_matcher.rb +12 -5
- data/lib/spec/matchers/raise_error.rb +1 -1
- data/lib/spec/matchers/respond_to.rb +1 -1
- data/lib/spec/matchers/satisfy.rb +5 -5
- data/lib/spec/matchers/throw_symbol.rb +1 -3
- data/lib/spec/mocks/argument_expectation.rb +1 -1
- data/lib/spec/mocks/argument_matchers.rb +233 -0
- data/lib/spec/mocks/error_generator.rb +2 -6
- data/lib/spec/mocks/message_expectation.rb +3 -11
- data/lib/spec/mocks/mock.rb +1 -1
- data/lib/spec/mocks/proxy.rb +5 -1
- data/lib/spec/runner/configuration.rb +3 -3
- data/lib/spec/runner/drb_command_line.rb +2 -1
- data/lib/spec/runner/example_group_runner.rb +2 -1
- data/lib/spec/runner/formatter/base_text_formatter.rb +28 -17
- data/lib/spec/runner/formatter/failing_example_groups_formatter.rb +3 -5
- data/lib/spec/runner/formatter/html_formatter.rb +2 -3
- data/lib/spec/runner/formatter/nested_text_formatter.rb +7 -25
- data/lib/spec/runner/formatter/progress_bar_formatter.rb +1 -1
- data/lib/spec/runner/formatter/specdoc_formatter.rb +1 -7
- data/lib/spec/runner/heckle_runner_unsupported.rb +1 -1
- data/lib/spec/runner/option_parser.rb +16 -19
- data/lib/spec/runner/options.rb +28 -26
- data/lib/spec/runner/reporter.rb +8 -9
- data/lib/spec/runner.rb +6 -28
- data/lib/spec/test/unit.rb +10 -0
- data/lib/spec/version.rb +2 -2
- data/{features/support → resources}/helpers/cmdline.rb +2 -2
- data/resources/rake/verify_rcov.rake +1 -1
- data/resources/spec/example_group_with_should_methods.rb +1 -1
- data/resources/spec/simple_spec.rb +1 -1
- data/resources/test/spec_and_test_together.rb +2 -3
- data/resources/test/spec_including_test_but_not_unit.rb +1 -1
- data/resources/test/test_case_with_should_methods.rb +2 -3
- data/rspec.gemspec +5 -5
- data/spec/spec/dsl/main_spec.rb +3 -3
- data/spec/spec/example/example_group_class_definition_spec.rb +11 -14
- data/spec/spec/example/example_group_factory_spec.rb +31 -44
- data/spec/spec/example/example_group_methods_spec.rb +86 -52
- data/spec/spec/example/example_group_spec.rb +16 -75
- data/spec/spec/example/example_matcher_spec.rb +10 -10
- data/spec/spec/example/example_methods_spec.rb +101 -241
- data/spec/spec/example/nested_example_group_spec.rb +2 -2
- data/spec/spec/example/pending_module_spec.rb +1 -1
- data/spec/spec/example/shared_example_group_spec.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_that_fails.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_that_passes.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_with_errors.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_with_options_hash.rb +2 -2
- data/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +2 -2
- data/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +2 -2
- data/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +2 -2
- data/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +2 -2
- data/spec/spec/matchers/change_spec.rb +8 -0
- data/spec/spec/matchers/exist_spec.rb +8 -4
- data/spec/spec/matchers/handler_spec.rb +8 -1
- data/spec/spec/matchers/matcher_methods_spec.rb +1 -1
- data/spec/spec/mocks/{bug_report_496.rb → bug_report_496_spec.rb} +0 -0
- data/spec/spec/mocks/failing_argument_matchers_spec.rb +95 -0
- data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
- data/spec/spec/mocks/passing_argument_matchers_spec.rb +145 -0
- data/spec/spec/runner/configuration_spec.rb +12 -12
- data/spec/spec/runner/formatter/base_text_formatter_spec.rb +72 -1
- data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +8 -8
- data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +4 -4
- data/spec/spec/runner/formatter/html_formatted-1.8.6.html +8 -8
- data/spec/spec/runner/formatter/html_formatted-1.8.7.html +38 -26
- data/spec/spec/runner/formatter/html_formatted-1.9.1.html +61 -53
- data/spec/spec/runner/formatter/html_formatter_spec.rb +100 -48
- data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +20 -34
- data/spec/spec/runner/formatter/profile_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +8 -6
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +6 -6
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +20 -20
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +38 -26
- data/spec/spec/runner/formatter/{spec_mate_formatter_spec.rb → text_mate_formatter_spec.rb} +10 -8
- data/spec/spec/runner/heckle_runner_spec.rb +1 -1
- data/spec/spec/runner/option_parser_spec.rb +15 -13
- data/spec/spec/runner/options_spec.rb +34 -0
- data/spec/spec/runner/reporter_spec.rb +65 -61
- data/spec/spec/runner/spec_drb.opts +1 -0
- data/spec/spec/runner_spec.rb +7 -5
- data/spec/spec_helper.rb +23 -0
- metadata +25 -76
- data/examples/passing/legacy_spec.rb +0 -11
- data/features/support/helpers/story_helper.rb +0 -13
- data/lib/spec/expectations/extensions/string_and_symbol.rb +0 -17
- data/resources/spec/spec_with_flexmock.rb +0 -19
- data/spec/spec/spec_spec.rb +0 -21
@@ -144,21 +144,11 @@ describe "OptionParser" do
|
|
144
144
|
options.formatters[0].class.should equal(Spec::Runner::Formatter::HtmlFormatter)
|
145
145
|
end
|
146
146
|
|
147
|
-
it "should use html story formatter when format is h" do
|
148
|
-
options = parse(["--format", "h"])
|
149
|
-
options.story_formatters[0].class.should equal(Spec::Runner::Formatter::Story::HtmlFormatter)
|
150
|
-
end
|
151
|
-
|
152
147
|
it "should use html formatter when format is html" do
|
153
148
|
options = parse(["--format", "html"])
|
154
149
|
options.formatters[0].class.should equal(Spec::Runner::Formatter::HtmlFormatter)
|
155
150
|
end
|
156
151
|
|
157
|
-
it "should use html story formatter when format is html" do
|
158
|
-
options = parse(["--format", "html"])
|
159
|
-
options.story_formatters[0].class.should equal(Spec::Runner::Formatter::Story::HtmlFormatter)
|
160
|
-
end
|
161
|
-
|
162
152
|
it "should use html formatter with explicit output when format is html:test.html" do
|
163
153
|
FileUtils.rm 'test.html' if File.exist?('test.html')
|
164
154
|
options = parse(["--format", "html:test.html"])
|
@@ -299,7 +289,13 @@ describe "OptionParser" do
|
|
299
289
|
it "should barf when --heckle is specified (and platform is windows)" do
|
300
290
|
lambda do
|
301
291
|
options = parse(["--heckle", "Spec"])
|
302
|
-
end.should raise_error(StandardError,
|
292
|
+
end.should raise_error(StandardError, /Heckle is not supported/)
|
293
|
+
end
|
294
|
+
elsif Spec::Ruby.version.to_f == 1.9
|
295
|
+
it "should barf when --heckle is specified (and platform is Ruby 1.9)" do
|
296
|
+
lambda do
|
297
|
+
options = parse(["--heckle", "Spec"])
|
298
|
+
end.should raise_error(StandardError, /Heckle is not supported/)
|
303
299
|
end
|
304
300
|
else
|
305
301
|
it "should heckle when --heckle is specified (and platform is not windows)" do
|
@@ -320,11 +316,17 @@ describe "OptionParser" do
|
|
320
316
|
end
|
321
317
|
|
322
318
|
it "should run parse drb after parsing options" do
|
323
|
-
@parser.
|
324
|
-
@parser.should_receive(:parse_drb).with(["--drb"]).and_return(true)
|
319
|
+
@parser.should_receive(:parse_drb).with(no_args).and_return(true)
|
325
320
|
options = parse(["--options", File.dirname(__FILE__) + "/spec_drb.opts"])
|
326
321
|
end
|
327
322
|
|
323
|
+
it "should send all the arguments others than --drb back to the parser after parsing options" do
|
324
|
+
Spec::Runner::DrbCommandLine.should_receive(:run).and_return do |options|
|
325
|
+
options.argv.should == ["example_file.rb", "--colour"]
|
326
|
+
end
|
327
|
+
options = parse(["example_file.rb", "--options", File.dirname(__FILE__) + "/spec_drb.opts"])
|
328
|
+
end
|
329
|
+
|
328
330
|
it "should read spaced and multi-line options from file when --options is specified" do
|
329
331
|
options = parse(["--options", File.dirname(__FILE__) + "/spec_spaced.opts"])
|
330
332
|
options.diff_format.should_not be_nil
|
@@ -312,6 +312,40 @@ module Spec
|
|
312
312
|
end
|
313
313
|
|
314
314
|
describe "#run_examples" do
|
315
|
+
describe "with global predicate matchers" do
|
316
|
+
it "defines global predicate matcher methods on ExampleMethods" do
|
317
|
+
Spec::Runner.configuration.stub!(:predicate_matchers).and_return({:this => :that?})
|
318
|
+
group = Class.new(::Spec::Example::ExampleGroupDouble).describe("Some Examples")
|
319
|
+
example = group.new("")
|
320
|
+
|
321
|
+
@options.run_examples
|
322
|
+
example.this
|
323
|
+
end
|
324
|
+
|
325
|
+
after(:each) do
|
326
|
+
Spec::Example::ExampleMethods.class_eval "undef :this"
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
describe "with a mock framework defined as a Symbol" do
|
331
|
+
it "includes Spec::Adapters::MockFramework" do
|
332
|
+
Spec::Runner.configuration.stub!(:mock_framework).and_return('spec/adapters/mock_frameworks/rspec')
|
333
|
+
|
334
|
+
Spec::Example::ExampleMethods.should_receive(:include).with(Spec::Adapters::MockFramework)
|
335
|
+
|
336
|
+
@options.run_examples
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
describe "with a mock framework defined as a Module" do
|
341
|
+
it "includes the module in ExampleMethods" do
|
342
|
+
mod = Module.new
|
343
|
+
Spec::Runner.configuration.stub!(:mock_framework).and_return(mod)
|
344
|
+
Spec::Example::ExampleMethods.should_receive(:include).with(mod)
|
345
|
+
@options.run_examples
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
315
349
|
describe "when not given a custom runner" do
|
316
350
|
it "should use the standard" do
|
317
351
|
runner = ::Spec::Runner::ExampleGroupRunner.new(@options)
|
@@ -13,15 +13,15 @@ module Spec
|
|
13
13
|
options.formatters << formatter
|
14
14
|
@reporter = Reporter.new(options)
|
15
15
|
@example_group = create_example_group("example_group")
|
16
|
-
reporter
|
16
|
+
example_group.notify(reporter)
|
17
17
|
end
|
18
18
|
|
19
19
|
def failure
|
20
20
|
Mocks::ArgumentMatchers::DuckTypeMatcher.new(:header, :exception)
|
21
21
|
end
|
22
22
|
|
23
|
-
def create_example_group(
|
24
|
-
example_group = Spec::Example::ExampleGroup.describe(
|
23
|
+
def create_example_group(text)
|
24
|
+
example_group = Spec::Example::ExampleGroup.describe(text) do
|
25
25
|
it "should do something" do
|
26
26
|
end
|
27
27
|
end
|
@@ -31,12 +31,12 @@ module Spec
|
|
31
31
|
it "should assign itself as the reporter to options" do
|
32
32
|
options.reporter.should equal(@reporter)
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
it "should tell formatter when example_group is added" do
|
36
36
|
formatter.should_receive(:add_example_group).with(example_group)
|
37
|
-
|
37
|
+
example_group.notify(reporter)
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
it "should handle multiple example_groups with same name" do
|
41
41
|
formatter.should_receive(:add_example_group).exactly(3).times
|
42
42
|
formatter.should_receive(:example_started).exactly(3).times
|
@@ -45,27 +45,31 @@ module Spec
|
|
45
45
|
formatter.should_receive(:dump_pending)
|
46
46
|
formatter.should_receive(:close).with(no_args)
|
47
47
|
formatter.should_receive(:dump_summary).with(anything(), 3, 0, 0)
|
48
|
-
|
49
|
-
reporter.example_started("spec 1")
|
50
|
-
reporter.example_finished("spec 1")
|
51
|
-
|
52
|
-
reporter.example_started("spec 2")
|
53
|
-
reporter.example_finished("spec 2")
|
54
|
-
|
55
|
-
reporter.example_started("spec 3")
|
56
|
-
reporter.example_finished("spec 3")
|
48
|
+
create_example_group("example_group").notify(reporter)
|
49
|
+
reporter.example_started(description_of("spec 1"))
|
50
|
+
reporter.example_finished(description_of("spec 1"))
|
51
|
+
create_example_group("example_group").notify(reporter)
|
52
|
+
reporter.example_started(description_of("spec 2"))
|
53
|
+
reporter.example_finished(description_of("spec 2"))
|
54
|
+
create_example_group("example_group").notify(reporter)
|
55
|
+
reporter.example_started(description_of("spec 3"))
|
56
|
+
reporter.example_finished(description_of("spec 3"))
|
57
57
|
reporter.dump
|
58
58
|
end
|
59
|
+
|
60
|
+
def description_of(example)
|
61
|
+
::Spec::Example::ExampleDescription.new(String === example ? example : example.description)
|
62
|
+
end
|
59
63
|
|
60
64
|
it "should handle multiple examples with the same name" do
|
61
65
|
error=RuntimeError.new
|
62
|
-
passing =
|
63
|
-
failing =
|
66
|
+
passing = ::Spec::Example::ExampleGroupDouble.new("an example")
|
67
|
+
failing = ::Spec::Example::ExampleGroupDouble.new("an example")
|
64
68
|
|
65
69
|
formatter.should_receive(:add_example_group).exactly(2).times
|
66
|
-
formatter.should_receive(:example_passed).with(passing).exactly(2).times
|
67
|
-
formatter.should_receive(:example_failed).with(failing, 1, failure)
|
68
|
-
formatter.should_receive(:example_failed).with(failing, 2, failure)
|
70
|
+
formatter.should_receive(:example_passed).with(description_of(passing)).exactly(2).times
|
71
|
+
formatter.should_receive(:example_failed).with(description_of(failing), 1, failure)
|
72
|
+
formatter.should_receive(:example_failed).with(description_of(failing), 2, failure)
|
69
73
|
formatter.should_receive(:dump_failure).exactly(2).times
|
70
74
|
formatter.should_receive(:start_dump)
|
71
75
|
formatter.should_receive(:dump_pending)
|
@@ -73,13 +77,13 @@ module Spec
|
|
73
77
|
formatter.should_receive(:dump_summary).with(anything(), 4, 2, 0)
|
74
78
|
backtrace_tweaker.should_receive(:tweak_backtrace).twice
|
75
79
|
|
76
|
-
|
77
|
-
reporter.example_finished(passing)
|
78
|
-
reporter.example_finished(failing, error)
|
80
|
+
create_example_group("example_group").notify(reporter)
|
81
|
+
reporter.example_finished(description_of(passing))
|
82
|
+
reporter.example_finished(description_of(failing), error)
|
79
83
|
|
80
|
-
|
81
|
-
reporter.example_finished(passing)
|
82
|
-
reporter.example_finished(failing, error)
|
84
|
+
create_example_group("example_group").notify(reporter)
|
85
|
+
reporter.example_finished(description_of(passing))
|
86
|
+
reporter.example_finished(description_of(failing), error)
|
83
87
|
reporter.dump
|
84
88
|
end
|
85
89
|
|
@@ -90,7 +94,7 @@ module Spec
|
|
90
94
|
formatter.should_receive(:close).with(no_args)
|
91
95
|
reporter.dump
|
92
96
|
end
|
93
|
-
|
97
|
+
|
94
98
|
it "should push time to formatter" do
|
95
99
|
formatter.should_receive(:start).with(5)
|
96
100
|
formatter.should_receive(:start_dump)
|
@@ -103,57 +107,57 @@ module Spec
|
|
103
107
|
reporter.end
|
104
108
|
reporter.dump
|
105
109
|
end
|
106
|
-
|
110
|
+
|
107
111
|
describe "reporting one passing example" do
|
108
112
|
it "should tell formatter example passed" do
|
109
113
|
formatter.should_receive(:example_passed)
|
110
|
-
reporter.example_finished("example")
|
114
|
+
reporter.example_finished(description_of("example"))
|
111
115
|
end
|
112
|
-
|
116
|
+
|
113
117
|
it "should not delegate to backtrace tweaker" do
|
114
118
|
formatter.should_receive(:example_passed)
|
115
119
|
backtrace_tweaker.should_not_receive(:tweak_backtrace)
|
116
|
-
reporter.example_finished("example")
|
120
|
+
reporter.example_finished(description_of("example"))
|
117
121
|
end
|
118
|
-
|
122
|
+
|
119
123
|
it "should account for passing example in stats" do
|
120
124
|
formatter.should_receive(:example_passed)
|
121
125
|
formatter.should_receive(:start_dump)
|
122
126
|
formatter.should_receive(:dump_pending)
|
123
127
|
formatter.should_receive(:dump_summary).with(anything(), 1, 0, 0)
|
124
128
|
formatter.should_receive(:close).with(no_args)
|
125
|
-
reporter.example_finished("example")
|
129
|
+
reporter.example_finished(description_of("example"))
|
126
130
|
reporter.dump
|
127
131
|
end
|
128
132
|
end
|
129
|
-
|
133
|
+
|
130
134
|
describe "reporting one failing example" do
|
131
135
|
it "should tell formatter that example failed" do
|
132
136
|
example = example_group.it("should do something") {}
|
133
137
|
formatter.should_receive(:example_failed)
|
134
|
-
reporter.example_finished(example, RuntimeError.new)
|
138
|
+
reporter.example_finished(description_of(example), RuntimeError.new)
|
135
139
|
end
|
136
|
-
|
140
|
+
|
137
141
|
it "should delegate to backtrace tweaker" do
|
138
142
|
formatter.should_receive(:example_failed)
|
139
143
|
backtrace_tweaker.should_receive(:tweak_backtrace)
|
140
|
-
reporter.example_finished(ExampleGroup.new("example"), RuntimeError.new)
|
144
|
+
reporter.example_finished(description_of(ExampleGroup.new("example")), RuntimeError.new)
|
141
145
|
end
|
142
|
-
|
146
|
+
|
143
147
|
it "should account for failing example in stats" do
|
144
|
-
example =
|
145
|
-
formatter.should_receive(:example_failed).with(example, 1, failure)
|
148
|
+
example = ::Spec::Example::ExampleGroupDouble.new("example")
|
149
|
+
formatter.should_receive(:example_failed).with(description_of(example), 1, failure)
|
146
150
|
formatter.should_receive(:start_dump)
|
147
151
|
formatter.should_receive(:dump_pending)
|
148
152
|
formatter.should_receive(:dump_failure).with(1, anything())
|
149
153
|
formatter.should_receive(:dump_summary).with(anything(), 1, 1, 0)
|
150
154
|
formatter.should_receive(:close).with(no_args)
|
151
|
-
reporter.example_finished(example, RuntimeError.new)
|
155
|
+
reporter.example_finished(description_of(example), RuntimeError.new)
|
152
156
|
reporter.dump
|
153
157
|
end
|
154
|
-
|
158
|
+
|
155
159
|
end
|
156
|
-
|
160
|
+
|
157
161
|
describe "reporting one pending example (ExamplePendingError)" do
|
158
162
|
before :each do
|
159
163
|
@pending_error = Spec::Example::ExamplePendingError.new("reason")
|
@@ -162,22 +166,22 @@ module Spec
|
|
162
166
|
|
163
167
|
it "should tell formatter example is pending" do
|
164
168
|
example = ExampleGroup.new("example")
|
165
|
-
formatter.should_receive(:example_pending).with(example, "reason", @pending_caller)
|
169
|
+
formatter.should_receive(:example_pending).with(description_of(example), "reason", @pending_caller)
|
166
170
|
formatter.should_receive(:add_example_group).with(example_group)
|
167
|
-
|
168
|
-
reporter.example_finished(example, @pending_error)
|
171
|
+
example_group.notify(reporter)
|
172
|
+
reporter.example_finished(description_of(example), @pending_error)
|
169
173
|
end
|
170
|
-
|
174
|
+
|
171
175
|
it "should account for pending example in stats" do
|
172
176
|
example = ExampleGroup.new("example")
|
173
|
-
formatter.should_receive(:example_pending).with(example, "reason", @pending_caller)
|
177
|
+
formatter.should_receive(:example_pending).with(description_of(example), "reason", @pending_caller)
|
174
178
|
formatter.should_receive(:start_dump)
|
175
179
|
formatter.should_receive(:dump_pending)
|
176
180
|
formatter.should_receive(:dump_summary).with(anything(), 1, 0, 1)
|
177
181
|
formatter.should_receive(:close).with(no_args)
|
178
182
|
formatter.should_receive(:add_example_group).with(example_group)
|
179
|
-
|
180
|
-
reporter.example_finished(example, @pending_error)
|
183
|
+
example_group.notify(reporter)
|
184
|
+
reporter.example_finished(description_of(example), @pending_error)
|
181
185
|
reporter.dump
|
182
186
|
end
|
183
187
|
|
@@ -187,7 +191,7 @@ module Spec
|
|
187
191
|
|
188
192
|
@deprecated_formatter = Class.new(@formatter.class) do
|
189
193
|
attr_reader :example_passed_to_method, :message_passed_to_method
|
190
|
-
|
194
|
+
|
191
195
|
def example_pending(example_passed_to_method, message_passed_to_method)
|
192
196
|
@example_passed_to_method = example_passed_to_method
|
193
197
|
@message_passed_to_method = message_passed_to_method
|
@@ -199,16 +203,16 @@ module Spec
|
|
199
203
|
|
200
204
|
it "should pass the correct example to the formatter" do
|
201
205
|
example = ExampleGroup.new("example")
|
202
|
-
|
203
|
-
reporter.example_finished(example, @pending_error)
|
206
|
+
example_group.notify(reporter)
|
207
|
+
reporter.example_finished(description_of(example), @pending_error)
|
204
208
|
|
205
|
-
|
209
|
+
@deprecated_formatter.example_passed_to_method.should == description_of(example)
|
206
210
|
end
|
207
211
|
|
208
212
|
it "should pass the correct pending error message to the formatter" do
|
209
213
|
example = ExampleGroup.new("example")
|
210
|
-
|
211
|
-
reporter.example_finished(example, @pending_error)
|
214
|
+
example_group.notify(reporter)
|
215
|
+
reporter.example_finished(description_of(example), @pending_error)
|
212
216
|
|
213
217
|
@deprecated_formatter.message_passed_to_method.should == @pending_error.message
|
214
218
|
end
|
@@ -217,20 +221,20 @@ module Spec
|
|
217
221
|
Kernel.should_receive(:warn).with(Spec::Runner::Reporter::EXAMPLE_PENDING_DEPRECATION_WARNING)
|
218
222
|
|
219
223
|
example = ExampleGroup.new("example")
|
220
|
-
|
221
|
-
reporter.example_finished(example, @pending_error)
|
224
|
+
example_group.notify(reporter)
|
225
|
+
reporter.example_finished(description_of(example), @pending_error)
|
222
226
|
end
|
223
227
|
end
|
224
228
|
end
|
225
|
-
|
229
|
+
|
226
230
|
describe "reporting one pending example (PendingExampleFixedError)" do
|
227
231
|
it "should tell formatter pending example is fixed" do
|
228
232
|
formatter.should_receive(:example_failed) do |name, counter, failure|
|
229
233
|
failure.header.should == "'example_group should do something' FIXED"
|
230
234
|
end
|
231
235
|
formatter.should_receive(:add_example_group).with(example_group)
|
232
|
-
|
233
|
-
reporter.example_finished(example_group.examples.first, Spec::Example::PendingExampleFixedError.new("reason"))
|
236
|
+
example_group.notify(reporter)
|
237
|
+
reporter.example_finished(description_of(example_group.examples.first), Spec::Example::PendingExampleFixedError.new("reason"))
|
234
238
|
end
|
235
239
|
end
|
236
240
|
end
|
data/spec/spec/runner_spec.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper.rb'
|
2
2
|
|
3
3
|
module Spec
|
4
|
-
describe Runner
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
describe Runner do
|
5
|
+
describe ".configure" do
|
6
|
+
it "should yield global configuration" do
|
7
|
+
Spec::Runner.configure do |config|
|
8
|
+
config.should equal(Spec::Runner.configuration)
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
11
|
-
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -82,3 +82,26 @@ def with_sandboxed_config
|
|
82
82
|
|
83
83
|
yield
|
84
84
|
end
|
85
|
+
|
86
|
+
module Spec
|
87
|
+
module Example
|
88
|
+
module Resettable
|
89
|
+
def reset # :nodoc:
|
90
|
+
@before_all_parts = nil
|
91
|
+
@after_all_parts = nil
|
92
|
+
@before_each_parts = nil
|
93
|
+
@after_each_parts = nil
|
94
|
+
end
|
95
|
+
end
|
96
|
+
class ExampleGroup
|
97
|
+
extend Resettable
|
98
|
+
end
|
99
|
+
class ExampleGroupDouble < ExampleGroup
|
100
|
+
::Spec::Runner.options.remove_example_group self
|
101
|
+
def register_example_group(klass)
|
102
|
+
#ignore
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dchelimsky-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.99.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RSpec Development Team
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-11 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- TODO.txt
|
43
43
|
- bin/autospec
|
44
44
|
- bin/spec
|
45
|
+
- cucumber.yml
|
45
46
|
- examples/failing/README.txt
|
46
47
|
- examples/failing/diffing_spec.rb
|
47
48
|
- examples/failing/failing_autogenerated_docstrings_example.rb
|
@@ -66,11 +67,12 @@ files:
|
|
66
67
|
- examples/passing/dynamic_spec.rb
|
67
68
|
- examples/passing/file_accessor.rb
|
68
69
|
- examples/passing/file_accessor_spec.rb
|
70
|
+
- examples/passing/filtered_formatter.rb
|
71
|
+
- examples/passing/filtered_formatter_example.rb
|
69
72
|
- examples/passing/greeter_spec.rb
|
70
73
|
- examples/passing/helper_method_example.rb
|
71
74
|
- examples/passing/io_processor.rb
|
72
75
|
- examples/passing/io_processor_spec.rb
|
73
|
-
- examples/passing/legacy_spec.rb
|
74
76
|
- examples/passing/mocking_example.rb
|
75
77
|
- examples/passing/multi_threaded_example_group_runner.rb
|
76
78
|
- examples/passing/nested_classes_example.rb
|
@@ -88,6 +90,7 @@ files:
|
|
88
90
|
- examples/passing/stubbing_example.rb
|
89
91
|
- examples/passing/yielding_example.rb
|
90
92
|
- examples/ruby1.9.compatibility/access_to_constants_spec.rb
|
93
|
+
- features-pending/cli/conditional_exclusion.feature
|
91
94
|
- features/before_and_after_blocks/before_and_after_blocks.feature
|
92
95
|
- features/example_groups/autogenerated_docstrings.feature
|
93
96
|
- features/example_groups/example_group_with_should_methods.feature
|
@@ -97,38 +100,42 @@ files:
|
|
97
100
|
- features/interop/test_but_not_test_unit.feature
|
98
101
|
- features/interop/test_case_with_should_methods.feature
|
99
102
|
- features/mock_framework_integration/use_flexmock.feature
|
103
|
+
- features/mock_framework_integration/use_mocha.feature
|
104
|
+
- features/mock_framework_integration/use_rr.feature
|
100
105
|
- features/step_definitions/running_rspec.rb
|
101
106
|
- features/support/env.rb
|
102
|
-
- features/support/helpers/cmdline.rb
|
103
|
-
- features/support/helpers/story_helper.rb
|
104
107
|
- features/support/matchers/smart_match.rb
|
105
108
|
- init.rb
|
106
|
-
- lib/adapters/mock_frameworks/flexmock.rb
|
107
|
-
- lib/adapters/mock_frameworks/mocha.rb
|
108
|
-
- lib/adapters/mock_frameworks/rr.rb
|
109
|
-
- lib/adapters/mock_frameworks/rspec.rb
|
110
109
|
- lib/autotest/discover.rb
|
111
110
|
- lib/autotest/rspec.rb
|
112
111
|
- lib/spec.rb
|
112
|
+
- lib/spec/adapters/mock_frameworks/flexmock.rb
|
113
|
+
- lib/spec/adapters/mock_frameworks/mocha.rb
|
114
|
+
- lib/spec/adapters/mock_frameworks/rr.rb
|
115
|
+
- lib/spec/adapters/mock_frameworks/rspec.rb
|
116
|
+
- lib/spec/autorun.rb
|
113
117
|
- lib/spec/dsl.rb
|
114
118
|
- lib/spec/dsl/main.rb
|
115
119
|
- lib/spec/example.rb
|
116
120
|
- lib/spec/example/before_and_after_hooks.rb
|
117
121
|
- lib/spec/example/errors.rb
|
122
|
+
- lib/spec/example/example_description.rb
|
118
123
|
- lib/spec/example/example_group.rb
|
119
124
|
- lib/spec/example/example_group_factory.rb
|
125
|
+
- lib/spec/example/example_group_hierarchy.rb
|
120
126
|
- lib/spec/example/example_group_methods.rb
|
121
127
|
- lib/spec/example/example_matcher.rb
|
122
128
|
- lib/spec/example/example_methods.rb
|
123
129
|
- lib/spec/example/module_reopening_fix.rb
|
124
130
|
- lib/spec/example/pending.rb
|
131
|
+
- lib/spec/example/predicate_matchers.rb
|
125
132
|
- lib/spec/example/shared_example_group.rb
|
133
|
+
- lib/spec/example/subject.rb
|
126
134
|
- lib/spec/expectations.rb
|
127
135
|
- lib/spec/expectations/differs/default.rb
|
128
136
|
- lib/spec/expectations/errors.rb
|
129
137
|
- lib/spec/expectations/extensions.rb
|
130
138
|
- lib/spec/expectations/extensions/object.rb
|
131
|
-
- lib/spec/expectations/extensions/string_and_symbol.rb
|
132
139
|
- lib/spec/expectations/handler.rb
|
133
140
|
- lib/spec/interop/test.rb
|
134
141
|
- lib/spec/interop/test/unit/autorunner.rb
|
@@ -159,8 +166,8 @@ files:
|
|
159
166
|
- lib/spec/matchers/throw_symbol.rb
|
160
167
|
- lib/spec/matchers/wrap_expectation.rb
|
161
168
|
- lib/spec/mocks.rb
|
162
|
-
- lib/spec/mocks/argument_constraints.rb
|
163
169
|
- lib/spec/mocks/argument_expectation.rb
|
170
|
+
- lib/spec/mocks/argument_matchers.rb
|
164
171
|
- lib/spec/mocks/error_generator.rb
|
165
172
|
- lib/spec/mocks/errors.rb
|
166
173
|
- lib/spec/mocks/extensions.rb
|
@@ -193,9 +200,6 @@ files:
|
|
193
200
|
- lib/spec/runner/formatter/progress_bar_formatter.rb
|
194
201
|
- lib/spec/runner/formatter/snippet_extractor.rb
|
195
202
|
- lib/spec/runner/formatter/specdoc_formatter.rb
|
196
|
-
- lib/spec/runner/formatter/story/html_formatter.rb
|
197
|
-
- lib/spec/runner/formatter/story/plain_text_formatter.rb
|
198
|
-
- lib/spec/runner/formatter/story/progress_bar_formatter.rb
|
199
203
|
- lib/spec/runner/formatter/text_mate_formatter.rb
|
200
204
|
- lib/spec/runner/heckle_runner.rb
|
201
205
|
- lib/spec/runner/heckle_runner_unsupported.rb
|
@@ -203,33 +207,15 @@ files:
|
|
203
207
|
- lib/spec/runner/options.rb
|
204
208
|
- lib/spec/runner/reporter.rb
|
205
209
|
- lib/spec/runner/spec_parser.rb
|
206
|
-
- lib/spec/
|
207
|
-
- lib/spec/story/extensions.rb
|
208
|
-
- lib/spec/story/extensions/main.rb
|
209
|
-
- lib/spec/story/extensions/regexp.rb
|
210
|
-
- lib/spec/story/extensions/string.rb
|
211
|
-
- lib/spec/story/given_scenario.rb
|
212
|
-
- lib/spec/story/runner.rb
|
213
|
-
- lib/spec/story/runner/plain_text_story_runner.rb
|
214
|
-
- lib/spec/story/runner/scenario_collector.rb
|
215
|
-
- lib/spec/story/runner/scenario_runner.rb
|
216
|
-
- lib/spec/story/runner/story_mediator.rb
|
217
|
-
- lib/spec/story/runner/story_parser.rb
|
218
|
-
- lib/spec/story/runner/story_runner.rb
|
219
|
-
- lib/spec/story/scenario.rb
|
220
|
-
- lib/spec/story/step.rb
|
221
|
-
- lib/spec/story/step_group.rb
|
222
|
-
- lib/spec/story/step_mother.rb
|
223
|
-
- lib/spec/story/story.rb
|
224
|
-
- lib/spec/story/world.rb
|
210
|
+
- lib/spec/test/unit.rb
|
225
211
|
- lib/spec/version.rb
|
212
|
+
- resources/helpers/cmdline.rb
|
226
213
|
- resources/rake/examples.rake
|
227
214
|
- resources/rake/examples_with_rcov.rake
|
228
215
|
- resources/rake/failing_examples_with_html.rake
|
229
216
|
- resources/rake/verify_rcov.rake
|
230
217
|
- resources/spec/example_group_with_should_methods.rb
|
231
218
|
- resources/spec/simple_spec.rb
|
232
|
-
- resources/spec/spec_with_flexmock.rb
|
233
219
|
- resources/test/spec_and_test_together.rb
|
234
220
|
- resources/test/spec_including_test_but_not_unit.rb
|
235
221
|
- resources/test/test_case_with_should_methods.rb
|
@@ -286,7 +272,6 @@ files:
|
|
286
272
|
- spec/spec/matchers/match_array_spec.rb
|
287
273
|
- spec/spec/matchers/match_spec.rb
|
288
274
|
- spec/spec/matchers/matcher_methods_spec.rb
|
289
|
-
- spec/spec/matchers/mock_constraint_matchers_spec.rb
|
290
275
|
- spec/spec/matchers/operator_matcher_spec.rb
|
291
276
|
- spec/spec/matchers/raise_error_spec.rb
|
292
277
|
- spec/spec/matchers/respond_to_spec.rb
|
@@ -301,13 +286,13 @@ files:
|
|
301
286
|
- spec/spec/mocks/bug_report_10263_spec.rb
|
302
287
|
- spec/spec/mocks/bug_report_11545_spec.rb
|
303
288
|
- spec/spec/mocks/bug_report_15719_spec.rb
|
304
|
-
- spec/spec/mocks/
|
289
|
+
- spec/spec/mocks/bug_report_496_spec.rb
|
305
290
|
- spec/spec/mocks/bug_report_600_spec.rb
|
306
291
|
- spec/spec/mocks/bug_report_7611_spec.rb
|
307
292
|
- spec/spec/mocks/bug_report_7805_spec.rb
|
308
293
|
- spec/spec/mocks/bug_report_8165_spec.rb
|
309
294
|
- spec/spec/mocks/bug_report_8302_spec.rb
|
310
|
-
- spec/spec/mocks/
|
295
|
+
- spec/spec/mocks/failing_argument_matchers_spec.rb
|
311
296
|
- spec/spec/mocks/hash_including_matcher_spec.rb
|
312
297
|
- spec/spec/mocks/hash_not_including_matcher_spec.rb
|
313
298
|
- spec/spec/mocks/mock_ordering_spec.rb
|
@@ -320,7 +305,7 @@ files:
|
|
320
305
|
- spec/spec/mocks/options_hash_spec.rb
|
321
306
|
- spec/spec/mocks/partial_mock_spec.rb
|
322
307
|
- spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb
|
323
|
-
- spec/spec/mocks/
|
308
|
+
- spec/spec/mocks/passing_argument_matchers_spec.rb
|
324
309
|
- spec/spec/mocks/precise_counts_spec.rb
|
325
310
|
- spec/spec/mocks/record_messages_spec.rb
|
326
311
|
- spec/spec/mocks/stub_spec.rb
|
@@ -351,15 +336,12 @@ files:
|
|
351
336
|
- spec/spec/runner/formatter/profile_formatter_spec.rb
|
352
337
|
- spec/spec/runner/formatter/progress_bar_formatter_spec.rb
|
353
338
|
- spec/spec/runner/formatter/snippet_extractor_spec.rb
|
354
|
-
- spec/spec/runner/formatter/spec_mate_formatter_spec.rb
|
355
339
|
- spec/spec/runner/formatter/specdoc_formatter_spec.rb
|
356
|
-
- spec/spec/runner/formatter/story/html_formatter_spec.rb
|
357
|
-
- spec/spec/runner/formatter/story/plain_text_formatter_spec.rb
|
358
|
-
- spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb
|
359
340
|
- spec/spec/runner/formatter/text_mate_formatted-1.8.4.html
|
360
341
|
- spec/spec/runner/formatter/text_mate_formatted-1.8.6.html
|
361
342
|
- spec/spec/runner/formatter/text_mate_formatted-1.8.7.html
|
362
343
|
- spec/spec/runner/formatter/text_mate_formatted-1.9.1.html
|
344
|
+
- spec/spec/runner/formatter/text_mate_formatter_spec.rb
|
363
345
|
- spec/spec/runner/heckle_runner_spec.rb
|
364
346
|
- spec/spec/runner/heckler_spec.rb
|
365
347
|
- spec/spec/runner/noisy_backtrace_tweaker_spec.rb
|
@@ -382,40 +364,7 @@ files:
|
|
382
364
|
- spec/spec/runner/spec_spaced.opts
|
383
365
|
- spec/spec/runner_spec.rb
|
384
366
|
- spec/spec/spec_classes.rb
|
385
|
-
- spec/spec/spec_spec.rb
|
386
|
-
- spec/spec/story/builders.rb
|
387
|
-
- spec/spec/story/extensions/main_spec.rb
|
388
|
-
- spec/spec/story/extensions_spec.rb
|
389
|
-
- spec/spec/story/given_scenario_spec.rb
|
390
|
-
- spec/spec/story/runner/plain_text_story_runner_spec.rb
|
391
|
-
- spec/spec/story/runner/scenario_collector_spec.rb
|
392
|
-
- spec/spec/story/runner/scenario_runner_spec.rb
|
393
|
-
- spec/spec/story/runner/story_mediator_spec.rb
|
394
|
-
- spec/spec/story/runner/story_parser_spec.rb
|
395
|
-
- spec/spec/story/runner/story_runner_spec.rb
|
396
|
-
- spec/spec/story/runner_spec.rb
|
397
|
-
- spec/spec/story/scenario_spec.rb
|
398
|
-
- spec/spec/story/step_group_spec.rb
|
399
|
-
- spec/spec/story/step_mother_spec.rb
|
400
|
-
- spec/spec/story/step_spec.rb
|
401
|
-
- spec/spec/story/story_helper.rb
|
402
|
-
- spec/spec/story/story_spec.rb
|
403
|
-
- spec/spec/story/world_spec.rb
|
404
367
|
- spec/spec_helper.rb
|
405
|
-
- story_server/prototype/javascripts/builder.js
|
406
|
-
- story_server/prototype/javascripts/controls.js
|
407
|
-
- story_server/prototype/javascripts/dragdrop.js
|
408
|
-
- story_server/prototype/javascripts/effects.js
|
409
|
-
- story_server/prototype/javascripts/prototype.js
|
410
|
-
- story_server/prototype/javascripts/rspec.js
|
411
|
-
- story_server/prototype/javascripts/scriptaculous.js
|
412
|
-
- story_server/prototype/javascripts/slider.js
|
413
|
-
- story_server/prototype/javascripts/sound.js
|
414
|
-
- story_server/prototype/javascripts/unittest.js
|
415
|
-
- story_server/prototype/lib/server.rb
|
416
|
-
- story_server/prototype/stories.html
|
417
|
-
- story_server/prototype/stylesheets/rspec.css
|
418
|
-
- story_server/prototype/stylesheets/test.css
|
419
368
|
has_rdoc: true
|
420
369
|
homepage: http://rspec.info/
|
421
370
|
post_install_message:
|
@@ -442,6 +391,6 @@ rubyforge_project: rspec
|
|
442
391
|
rubygems_version: 1.2.0
|
443
392
|
signing_key:
|
444
393
|
specification_version: 2
|
445
|
-
summary: rspec 1.1.
|
394
|
+
summary: rspec 1.1.99.1
|
446
395
|
test_files: []
|
447
396
|
|