dchelimsky-rspec 1.1.11.4 → 1.1.11.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -2
- data/Manifest.txt +7 -3
- data/Rakefile +1 -1
- data/examples/ruby1.9.compatibility/access_to_constants_spec.rb +86 -0
- data/features/before_and_after_blocks/before_and_after_blocks.feature +168 -0
- data/features/step_definitions/running_rspec.rb +7 -1
- data/lib/spec.rb +1 -0
- data/lib/spec/dsl/main.rb +2 -1
- data/lib/spec/example/before_and_after_hooks.rb +20 -2
- data/lib/spec/example/example_group_factory.rb +11 -0
- data/lib/spec/example/example_group_methods.rb +32 -35
- data/lib/spec/example/shared_example_group.rb +0 -4
- data/lib/spec/matchers/respond_to.rb +1 -2
- data/lib/spec/matchers/wrap_expectation.rb +1 -1
- data/lib/spec/mocks/proxy.rb +1 -1
- data/lib/spec/ruby.rb +9 -0
- data/lib/spec/runner/configuration.rb +6 -7
- data/lib/spec/runner/formatter/nested_text_formatter.rb +2 -2
- data/lib/spec/runner/heckle_runner.rb +58 -56
- data/lib/spec/runner/options.rb +9 -4
- data/lib/spec/version.rb +1 -1
- data/rspec.gemspec +5 -5
- data/spec/spec/dsl/main_spec.rb +21 -1
- data/spec/spec/example/example_group_methods_spec.rb +51 -0
- data/spec/spec/example/example_methods_spec.rb +1 -33
- data/spec/spec/matchers/have_spec.rb +2 -2
- data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
- data/spec/spec/mocks/stub_spec.rb +6 -0
- data/spec/spec/runner/configuration_spec.rb +11 -0
- data/spec/spec/runner/drb_command_line_spec.rb +4 -4
- data/spec/spec/runner/formatter/base_text_formatter_spec.rb +1 -0
- data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +5 -5
- data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +3 -3
- data/spec/spec/runner/formatter/html_formatted-1.8.6.html +24 -24
- data/spec/spec/runner/formatter/html_formatted-1.8.7.html +379 -0
- data/spec/spec/runner/formatter/html_formatted-1.9.1.html +379 -0
- data/spec/spec/runner/formatter/html_formatter_spec.rb +9 -13
- data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +4 -4
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +3 -3
- data/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +8 -12
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +4 -4
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +18 -18
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +373 -0
- data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +373 -0
- data/spec/spec/runner/heckler_spec.rb +16 -9
- data/spec/spec/runner/option_parser_spec.rb +0 -2
- data/spec/spec/runner/options_spec.rb +7 -2
- data/spec/spec/runner/reporter_spec.rb +4 -4
- data/spec/spec_helper.rb +4 -0
- metadata +10 -6
- data/features/configuration/before_blocks.feature +0 -21
- data/resources/spec/before_blocks_example.rb +0 -32
- data/spec/spec/example/example_runner_spec.rb +0 -194
data/spec/spec_helper.rb
CHANGED
@@ -12,6 +12,10 @@ spec_classes_path = File.expand_path("#{dir}/../spec/spec/spec_classes")
|
|
12
12
|
require spec_classes_path unless $LOAD_PATH.include?(spec_classes_path)
|
13
13
|
require File.dirname(__FILE__) + '/../lib/spec/expectations/differs/default'
|
14
14
|
|
15
|
+
def jruby?
|
16
|
+
::RUBY_PLATFORM == 'java'
|
17
|
+
end
|
18
|
+
|
15
19
|
module Spec
|
16
20
|
module Example
|
17
21
|
class NonStandardError < Exception; end
|
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.11.
|
4
|
+
version: 1.1.11.5
|
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:
|
12
|
+
date: 2009-01-04 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -87,7 +87,8 @@ files:
|
|
87
87
|
- examples/passing/stack_spec_with_nested_example_groups.rb
|
88
88
|
- examples/passing/stubbing_example.rb
|
89
89
|
- examples/passing/yielding_example.rb
|
90
|
-
-
|
90
|
+
- examples/ruby1.9.compatibility/access_to_constants_spec.rb
|
91
|
+
- features/before_and_after_blocks/before_and_after_blocks.feature
|
91
92
|
- features/example_groups/autogenerated_docstrings.feature
|
92
93
|
- features/example_groups/example_group_with_should_methods.feature
|
93
94
|
- features/example_groups/nested_groups.feature
|
@@ -174,6 +175,7 @@ files:
|
|
174
175
|
- lib/spec/mocks/spec_methods.rb
|
175
176
|
- lib/spec/rake/spectask.rb
|
176
177
|
- lib/spec/rake/verify_rcov.rb
|
178
|
+
- lib/spec/ruby.rb
|
177
179
|
- lib/spec/runner.rb
|
178
180
|
- lib/spec/runner/backtrace_tweaker.rb
|
179
181
|
- lib/spec/runner/class_and_arguments_parser.rb
|
@@ -225,7 +227,6 @@ files:
|
|
225
227
|
- resources/rake/examples_with_rcov.rake
|
226
228
|
- resources/rake/failing_examples_with_html.rake
|
227
229
|
- resources/rake/verify_rcov.rake
|
228
|
-
- resources/spec/before_blocks_example.rb
|
229
230
|
- resources/spec/example_group_with_should_methods.rb
|
230
231
|
- resources/spec/simple_spec.rb
|
231
232
|
- resources/spec/spec_with_flexmock.rb
|
@@ -249,7 +250,6 @@ files:
|
|
249
250
|
- spec/spec/example/example_group_spec.rb
|
250
251
|
- spec/spec/example/example_matcher_spec.rb
|
251
252
|
- spec/spec/example/example_methods_spec.rb
|
252
|
-
- spec/spec/example/example_runner_spec.rb
|
253
253
|
- spec/spec/example/helper_method_spec.rb
|
254
254
|
- spec/spec/example/nested_example_group_spec.rb
|
255
255
|
- spec/spec/example/pending_module_spec.rb
|
@@ -343,6 +343,8 @@ files:
|
|
343
343
|
- spec/spec/runner/formatter/html_formatted-1.8.5.html
|
344
344
|
- spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html
|
345
345
|
- spec/spec/runner/formatter/html_formatted-1.8.6.html
|
346
|
+
- spec/spec/runner/formatter/html_formatted-1.8.7.html
|
347
|
+
- spec/spec/runner/formatter/html_formatted-1.9.1.html
|
346
348
|
- spec/spec/runner/formatter/html_formatter_spec.rb
|
347
349
|
- spec/spec/runner/formatter/nested_text_formatter_spec.rb
|
348
350
|
- spec/spec/runner/formatter/profile_formatter_spec.rb
|
@@ -355,6 +357,8 @@ files:
|
|
355
357
|
- spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb
|
356
358
|
- spec/spec/runner/formatter/text_mate_formatted-1.8.4.html
|
357
359
|
- spec/spec/runner/formatter/text_mate_formatted-1.8.6.html
|
360
|
+
- spec/spec/runner/formatter/text_mate_formatted-1.8.7.html
|
361
|
+
- spec/spec/runner/formatter/text_mate_formatted-1.9.1.html
|
358
362
|
- spec/spec/runner/heckle_runner_spec.rb
|
359
363
|
- spec/spec/runner/heckler_spec.rb
|
360
364
|
- spec/spec/runner/noisy_backtrace_tweaker_spec.rb
|
@@ -436,6 +440,6 @@ rubyforge_project: rspec
|
|
436
440
|
rubygems_version: 1.2.0
|
437
441
|
signing_key:
|
438
442
|
specification_version: 2
|
439
|
-
summary: rspec 1.1.11.
|
443
|
+
summary: rspec 1.1.11.5
|
440
444
|
test_files: []
|
441
445
|
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Story: before suite
|
2
|
-
As a developer using rspec
|
3
|
-
I want to define before blocks in the global configuration
|
4
|
-
So that I can define global things globally
|
5
|
-
|
6
|
-
Scenario: running with ruby
|
7
|
-
|
8
|
-
Given the file ../../resources/spec/before_blocks_example.rb
|
9
|
-
|
10
|
-
When I run it with the ruby interpreter
|
11
|
-
|
12
|
-
Then the stdout should match "3 examples, 0 failures"
|
13
|
-
|
14
|
-
Scenario: running with spec
|
15
|
-
|
16
|
-
Given the file ../../resources/spec/before_blocks_example.rb
|
17
|
-
|
18
|
-
When I run it with the spec script
|
19
|
-
|
20
|
-
Then the stdout should match "3 examples, 0 failures"
|
21
|
-
|
@@ -1,32 +0,0 @@
|
|
1
|
-
$:.push File.join(File.dirname(__FILE__), *%w[.. .. lib])
|
2
|
-
require 'spec'
|
3
|
-
|
4
|
-
Spec::Runner.configure do |config|
|
5
|
-
config.before(:suite) do
|
6
|
-
$before_suite = "before suite"
|
7
|
-
end
|
8
|
-
config.before(:each) do
|
9
|
-
@before_each = "before each"
|
10
|
-
end
|
11
|
-
config.before(:all) do
|
12
|
-
@before_all = "before all"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "stuff in before blocks" do
|
17
|
-
describe "with :suite" do
|
18
|
-
it "should be available in the example" do
|
19
|
-
$before_suite.should == "before suite"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
describe "with :all" do
|
23
|
-
it "should be available in the example" do
|
24
|
-
@before_all.should == "before all"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
describe "with :each" do
|
28
|
-
it "should be available in the example" do
|
29
|
-
@before_each.should == "before each"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,194 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
-
|
3
|
-
module Spec
|
4
|
-
module Example
|
5
|
-
# describe "Spec::Example::ExampleRunner", "#run", :shared => true do
|
6
|
-
# before(:each) do
|
7
|
-
# @options = ::Spec::Runner::Options.new(StringIO.new, StringIO.new)
|
8
|
-
# @reporter = ::Spec::Runner::Reporter.new(@options)
|
9
|
-
# @options.reporter = @reporter
|
10
|
-
# @example_group_class = Class.new(ExampleGroup) do
|
11
|
-
# plugin_mock_framework
|
12
|
-
# describe("Some Examples")
|
13
|
-
# end
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# def create_runner(example_definition)
|
17
|
-
# example = @example_group_class.new(example_definition)
|
18
|
-
# runner = ExampleGroup.new(@options, example)
|
19
|
-
# runner.stub!(:verify_mocks)
|
20
|
-
# runner.stub!(:teardown_mocks)
|
21
|
-
# runner
|
22
|
-
# end
|
23
|
-
# end
|
24
|
-
#
|
25
|
-
# describe ExampleRunner, "#run with blank passing example" do
|
26
|
-
# it_should_behave_like "Spec::Example::ExampleRunner#run"
|
27
|
-
#
|
28
|
-
# before do
|
29
|
-
# @e = @example_group_class.it("example") {}
|
30
|
-
# @runner = create_runner(@e)
|
31
|
-
# end
|
32
|
-
#
|
33
|
-
# it "should send reporter example_started" do
|
34
|
-
# @reporter.should_receive(:example_started).with(equal(@e))
|
35
|
-
# @runner.run
|
36
|
-
# end
|
37
|
-
#
|
38
|
-
# it "should report its name for dry run" do
|
39
|
-
# @options.dry_run = true
|
40
|
-
# @reporter.should_receive(:example_finished).with(equal(@e), nil)
|
41
|
-
# @runner.run
|
42
|
-
# end
|
43
|
-
#
|
44
|
-
# it "should report success" do
|
45
|
-
# @reporter.should_receive(:example_finished).with(equal(@e), nil)
|
46
|
-
# @runner.run
|
47
|
-
# end
|
48
|
-
# end
|
49
|
-
#
|
50
|
-
# describe ExampleRunner, "#run with a failing example" do
|
51
|
-
# predicate_matchers[:is_a] = [:is_a?]
|
52
|
-
# it_should_behave_like "Spec::Example::ExampleRunner#run"
|
53
|
-
#
|
54
|
-
# before do
|
55
|
-
# @e = @example_group_class.it("example") do
|
56
|
-
# (2+2).should == 5
|
57
|
-
# end
|
58
|
-
# @runner = create_runner(@e)
|
59
|
-
# end
|
60
|
-
#
|
61
|
-
# it "should report failure due to failure" do
|
62
|
-
# @reporter.should_receive(:example_finished).with(
|
63
|
-
# equal(@e),
|
64
|
-
# is_a(Spec::Expectations::ExpectationNotMetError)
|
65
|
-
# )
|
66
|
-
# @runner.run
|
67
|
-
# end
|
68
|
-
# end
|
69
|
-
#
|
70
|
-
# describe ExampleRunner, "#run with a erroring example" do
|
71
|
-
# it_should_behave_like "Spec::Example::ExampleRunner#run"
|
72
|
-
#
|
73
|
-
# before do
|
74
|
-
# @error = error = NonStandardError.new("in body")
|
75
|
-
# @example_definition = @example_group_class.it("example") do
|
76
|
-
# raise(error)
|
77
|
-
# end
|
78
|
-
# @runner = create_runner(@example_definition)
|
79
|
-
# end
|
80
|
-
#
|
81
|
-
# it "should report failure due to error" do
|
82
|
-
# @reporter.should_receive(:example_finished).with(
|
83
|
-
# equal(@example_definition),
|
84
|
-
# @error
|
85
|
-
# )
|
86
|
-
# @runner.run
|
87
|
-
# end
|
88
|
-
#
|
89
|
-
# it "should run after_each block" do
|
90
|
-
# @example_group_class.after(:each) do
|
91
|
-
# raise("in after_each")
|
92
|
-
# end
|
93
|
-
# @reporter.should_receive(:example_finished) do |example_definition, error|
|
94
|
-
# example_definition.should equal(@example_definition)
|
95
|
-
# error.message.should eql("in body")
|
96
|
-
# end
|
97
|
-
# @runner.run
|
98
|
-
# end
|
99
|
-
# end
|
100
|
-
#
|
101
|
-
# describe ExampleRunner, "#run where after_each fails" do
|
102
|
-
# it_should_behave_like "Spec::Example::ExampleRunner#run"
|
103
|
-
#
|
104
|
-
# before do
|
105
|
-
# @example_ran = example_ran = false
|
106
|
-
# @example_definition = @example_group_class.it("should not run") do
|
107
|
-
# example_ran = true
|
108
|
-
# end
|
109
|
-
# @runner = create_runner(@example_definition)
|
110
|
-
# @example_group_class.after(:each) { raise(NonStandardError.new("in after_each")) }
|
111
|
-
# end
|
112
|
-
#
|
113
|
-
# it "should report failure location when in after_each" do
|
114
|
-
# @reporter.should_receive(:example_finished) do |example_definition, error|
|
115
|
-
# example_definition.should equal(@example_definition)
|
116
|
-
# error.message.should eql("in after_each")
|
117
|
-
# end
|
118
|
-
# @runner.run
|
119
|
-
# end
|
120
|
-
# end
|
121
|
-
#
|
122
|
-
# describe ExampleRunner, "#run with use cases" do
|
123
|
-
# predicate_matchers[:is_a] = [:is_a?]
|
124
|
-
# it_should_behave_like "Spec::Example::ExampleRunner#run"
|
125
|
-
#
|
126
|
-
# it "should report NO NAME when told to use generated description with --dry-run" do
|
127
|
-
# @options.dry_run = true
|
128
|
-
# example_definition = @example_group_class.it() do
|
129
|
-
# 5.should == 5
|
130
|
-
# end
|
131
|
-
# runner = create_runner(example_definition)
|
132
|
-
#
|
133
|
-
# @reporter.should_receive(:example_finished) do |example_definition, error|
|
134
|
-
# example_definition.description.should == "NO NAME (Because of --dry-run)"
|
135
|
-
# end
|
136
|
-
# runner.run
|
137
|
-
# end
|
138
|
-
#
|
139
|
-
# it "should report given name if present with --dry-run" do
|
140
|
-
# @options.dry_run = true
|
141
|
-
# example_definition = @example_group_class.it("example name") do
|
142
|
-
# 5.should == 5
|
143
|
-
# end
|
144
|
-
# runner = create_runner(example_definition)
|
145
|
-
#
|
146
|
-
# @reporter.should_receive(:example_finished) do |example_definition, error|
|
147
|
-
# example_definition.description.should == "example name"
|
148
|
-
# end
|
149
|
-
# runner.run
|
150
|
-
# end
|
151
|
-
#
|
152
|
-
# it "should report NO NAME when told to use generated description with no expectations" do
|
153
|
-
# example_definition = @example_group_class.it() {}
|
154
|
-
# runner = create_runner(example_definition)
|
155
|
-
# @reporter.should_receive(:example_finished) do |example, error|
|
156
|
-
# example.description.should == "NO NAME (Because there were no expectations)"
|
157
|
-
# end
|
158
|
-
# runner.run
|
159
|
-
# end
|
160
|
-
#
|
161
|
-
# it "should report NO NAME when told to use generated description and matcher fails" do
|
162
|
-
# example_definition = @example_group_class.it() do
|
163
|
-
# 5.should "" # Has no matches? method..
|
164
|
-
# end
|
165
|
-
# runner = create_runner(example_definition)
|
166
|
-
#
|
167
|
-
# @reporter.should_receive(:example_finished) do |example, error|
|
168
|
-
# example_definition.description.should == "NO NAME (Because of Error raised in matcher)"
|
169
|
-
# end
|
170
|
-
# runner.run
|
171
|
-
# end
|
172
|
-
#
|
173
|
-
# it "should report generated description when told to and it is available" do
|
174
|
-
# example_definition = @example_group_class.it() {
|
175
|
-
# 5.should == 5
|
176
|
-
# }
|
177
|
-
# runner = create_runner(example_definition)
|
178
|
-
#
|
179
|
-
# @reporter.should_receive(:example_finished) do |example_definition, error|
|
180
|
-
# example_definition.description.should == "should == 5"
|
181
|
-
# end
|
182
|
-
# runner.run
|
183
|
-
# end
|
184
|
-
#
|
185
|
-
# it "should unregister description_generated callback (lest a memory leak should build up)" do
|
186
|
-
# example_definition = @example_group_class.it("something")
|
187
|
-
# runner = create_runner(example_definition)
|
188
|
-
#
|
189
|
-
# Spec::Matchers.should_receive(:example_finished)
|
190
|
-
# runner.run
|
191
|
-
# end
|
192
|
-
# end
|
193
|
-
end
|
194
|
-
end
|