dchelimsky-rspec 1.1.99.9 → 1.1.99.13
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/.autotest +2 -1
- data/.document +7 -0
- data/History.txt +17 -4
- data/Manifest.txt +12 -2
- data/README.txt +1 -4
- data/Rakefile +1 -12
- data/Upgrade.markdown +62 -0
- data/examples/failing/pending_example.rb +9 -0
- data/features/matchers/create_matcher.feature +115 -0
- data/features/mocks/mix_stubs_and_mocks.feature +22 -0
- data/features/pending/pending_examples.feature +81 -0
- data/features/support/matchers/smart_match.rb +2 -2
- data/lib/spec.rb +1 -1
- data/lib/spec/dsl.rb +3 -1
- data/lib/spec/dsl/matchers.rb +13 -0
- data/lib/spec/example/example_group_methods.rb +6 -1
- data/lib/spec/example/example_methods.rb +5 -6
- data/lib/spec/example/subject.rb +1 -1
- data/lib/spec/expectations/handler.rb +13 -11
- data/lib/spec/matchers.rb +14 -3
- data/lib/spec/matchers/be.rb +2 -2
- data/lib/spec/matchers/be_close.rb +1 -1
- data/lib/spec/matchers/be_instance_of.rb +2 -2
- data/lib/spec/matchers/be_kind_of.rb +2 -2
- data/lib/spec/matchers/change.rb +3 -3
- data/lib/spec/matchers/eql.rb +2 -2
- data/lib/spec/matchers/equal.rb +2 -2
- data/lib/spec/matchers/exist.rb +2 -2
- data/lib/spec/matchers/extensions/instance_exec.rb +25 -0
- data/lib/spec/matchers/has.rb +2 -2
- data/lib/spec/matchers/have.rb +2 -2
- data/lib/spec/matchers/include.rb +2 -2
- data/lib/spec/matchers/match.rb +2 -2
- data/lib/spec/matchers/match_array.rb +2 -2
- data/lib/spec/matchers/matcher.rb +51 -0
- data/lib/spec/matchers/raise_error.rb +2 -2
- data/lib/spec/matchers/respond_to.rb +2 -2
- data/lib/spec/matchers/satisfy.rb +2 -2
- data/lib/spec/matchers/throw_symbol.rb +2 -2
- data/lib/spec/mocks/error_generator.rb +3 -2
- data/lib/spec/mocks/message_expectation.rb +1 -1
- data/lib/spec/mocks/proxy.rb +4 -4
- data/lib/spec/runner/option_parser.rb +1 -1
- data/lib/spec/version.rb +1 -1
- data/rspec.gemspec +6 -6
- data/spec/spec/dsl/matchers_spec.rb +25 -0
- data/spec/spec/example/example_methods_spec.rb +11 -5
- data/spec/spec/example/pending_module_spec.rb +66 -41
- data/spec/spec/{matchers → expectations}/handler_spec.rb +46 -5
- data/spec/spec/interop/test/unit/testcase_spec.rb +0 -4
- data/spec/spec/matchers/be_close_spec.rb +1 -1
- data/spec/spec/matchers/change_spec.rb +12 -0
- data/spec/spec/matchers/eql_spec.rb +2 -2
- data/spec/spec/matchers/equal_spec.rb +2 -2
- data/spec/spec/matchers/have_spec.rb +4 -4
- data/spec/spec/matchers/match_spec.rb +2 -2
- data/spec/spec/matchers/matcher_spec.rb +97 -0
- data/spec/spec/matchers/throw_symbol_spec.rb +8 -8
- data/spec/spec/mocks/mock_spec.rb +2 -2
- data/spec/spec/mocks/stubbed_message_expectations_spec.rb +13 -1
- metadata +16 -10
- data/examples/passing/priority.txt +0 -1
data/.autotest
CHANGED
data/.document
ADDED
data/History.txt
CHANGED
@@ -9,10 +9,19 @@ WARNINGS:
|
|
9
9
|
* require 'spec/test/unit' to invoke test/unit interop if you're using
|
10
10
|
RSpec's core (this is handled implicitly with spec-rails)
|
11
11
|
|
12
|
-
* setup
|
12
|
+
* setup and teardown are gone - use before and after instead
|
13
13
|
|
14
|
-
* you can still use setup
|
15
|
-
the base ExampleGroup class (which is implicit
|
14
|
+
* you can still use setup and teardown if you're using
|
15
|
+
Test::Unit::TestCase as the base ExampleGroup class (which is implicit
|
16
|
+
in rspec-rails)
|
17
|
+
|
18
|
+
* The matcher protocol has been improved. The old protocol is still
|
19
|
+
supported, so as long as you're not monkey patching rspec's built-in
|
20
|
+
matchers, or using extension libraries that do, this should not affect
|
21
|
+
you. If you run into trouble, you'll just need to change:
|
22
|
+
|
23
|
+
* failure_message => failure_message_for_should
|
24
|
+
* negative_failure_message => failure_message_for_should_not
|
16
25
|
|
17
26
|
* All references to rubygems have been removed from within rspec's code.
|
18
27
|
|
@@ -35,13 +44,17 @@ WARNINGS:
|
|
35
44
|
* added handling for does_not_match? for matchers that want to know the context in which they were called
|
36
45
|
* lots of ruby 1.9.1 compatibility fixes from Chad Humprhies
|
37
46
|
* improved feedback from be_kind_of/be_a_kind_of/be_instance_of/be_an_instance_of (Jakub Šťastný)
|
38
|
-
* added --silent (
|
47
|
+
* added --format silent (l) option, which is now the default when running --heckle (Bob Aman)
|
48
|
+
* sexy new custom matcher creation (Corey Haines & David Chelimsky - initial concept by Yehuda Katz)
|
49
|
+
* improved matcher protocol - old one is still supported, but new one is cleaner and prefered
|
39
50
|
|
40
51
|
* bug fixes
|
41
52
|
|
42
53
|
* support delegating operator matchers to subject with should_not
|
43
54
|
* all arguments are included if --drb is specified in spec.opts (Neil Buckley). Closes #671.
|
44
55
|
* added --autospec option hack (used internally) to get --color to work when using --drb and autospec.
|
56
|
+
* Fixed mock framework failure message bug in which similar calls were excluded from the output
|
57
|
+
* cryptic error message on change.rb when the from value is wrong (Michael Murray). Closes #706.
|
45
58
|
|
46
59
|
=== Version 1.1.12 / 2009-01-11
|
47
60
|
|
data/Manifest.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
.autotest
|
2
|
+
.document
|
2
3
|
History.txt
|
3
4
|
License.txt
|
4
5
|
Manifest.txt
|
@@ -6,6 +7,7 @@ README.txt
|
|
6
7
|
Rakefile
|
7
8
|
Ruby1.9.markdown
|
8
9
|
TODO.txt
|
10
|
+
Upgrade.markdown
|
9
11
|
bin/autospec
|
10
12
|
bin/spec
|
11
13
|
cucumber.yml
|
@@ -19,6 +21,7 @@ examples/failing/mocking_with_flexmock.rb
|
|
19
21
|
examples/failing/mocking_with_mocha.rb
|
20
22
|
examples/failing/mocking_with_rr.rb
|
21
23
|
examples/failing/partial_mock_example.rb
|
24
|
+
examples/failing/pending_example.rb
|
22
25
|
examples/failing/predicate_example.rb
|
23
26
|
examples/failing/raising_example.rb
|
24
27
|
examples/failing/spec_helper.rb
|
@@ -45,7 +48,6 @@ examples/passing/nested_classes_example.rb
|
|
45
48
|
examples/passing/partial_mock_example.rb
|
46
49
|
examples/passing/pending_example.rb
|
47
50
|
examples/passing/predicate_example.rb
|
48
|
-
examples/passing/priority.txt
|
49
51
|
examples/passing/shared_example_group_example.rb
|
50
52
|
examples/passing/shared_stack_examples.rb
|
51
53
|
examples/passing/simple_matcher_example.rb
|
@@ -66,9 +68,12 @@ features/heckle/heckle.feature
|
|
66
68
|
features/interop/examples_and_tests_together.feature
|
67
69
|
features/interop/test_but_not_test_unit.feature
|
68
70
|
features/interop/test_case_with_should_methods.feature
|
71
|
+
features/matchers/create_matcher.feature
|
69
72
|
features/mock_framework_integration/use_flexmock.feature
|
70
73
|
features/mock_framework_integration/use_mocha.feature
|
71
74
|
features/mock_framework_integration/use_rr.feature
|
75
|
+
features/mocks/mix_stubs_and_mocks.feature
|
76
|
+
features/pending/pending_examples.feature
|
72
77
|
features/step_definitions/running_rspec.rb
|
73
78
|
features/support/env.rb
|
74
79
|
features/support/matchers/smart_match.rb
|
@@ -83,6 +88,7 @@ lib/spec/adapters/mock_frameworks/rspec.rb
|
|
83
88
|
lib/spec/autorun.rb
|
84
89
|
lib/spec/dsl.rb
|
85
90
|
lib/spec/dsl/main.rb
|
91
|
+
lib/spec/dsl/matchers.rb
|
86
92
|
lib/spec/example.rb
|
87
93
|
lib/spec/example/before_and_after_hooks.rb
|
88
94
|
lib/spec/example/errors.rb
|
@@ -120,12 +126,14 @@ lib/spec/matchers/eql.rb
|
|
120
126
|
lib/spec/matchers/equal.rb
|
121
127
|
lib/spec/matchers/errors.rb
|
122
128
|
lib/spec/matchers/exist.rb
|
129
|
+
lib/spec/matchers/extensions/instance_exec.rb
|
123
130
|
lib/spec/matchers/generated_descriptions.rb
|
124
131
|
lib/spec/matchers/has.rb
|
125
132
|
lib/spec/matchers/have.rb
|
126
133
|
lib/spec/matchers/include.rb
|
127
134
|
lib/spec/matchers/match.rb
|
128
135
|
lib/spec/matchers/match_array.rb
|
136
|
+
lib/spec/matchers/matcher.rb
|
129
137
|
lib/spec/matchers/method_missing.rb
|
130
138
|
lib/spec/matchers/operator_matcher.rb
|
131
139
|
lib/spec/matchers/raise_error.rb
|
@@ -199,6 +207,7 @@ spec/rspec_suite.rb
|
|
199
207
|
spec/ruby_forker.rb
|
200
208
|
spec/spec.opts
|
201
209
|
spec/spec/dsl/main_spec.rb
|
210
|
+
spec/spec/dsl/matchers_spec.rb
|
202
211
|
spec/spec/example/example_group_class_definition_spec.rb
|
203
212
|
spec/spec/example/example_group_factory_spec.rb
|
204
213
|
spec/spec/example/example_group_methods_spec.rb
|
@@ -214,6 +223,7 @@ spec/spec/example/subclassing_example_group_spec.rb
|
|
214
223
|
spec/spec/expectations/differs/default_spec.rb
|
215
224
|
spec/spec/expectations/extensions/object_spec.rb
|
216
225
|
spec/spec/expectations/fail_with_spec.rb
|
226
|
+
spec/spec/expectations/handler_spec.rb
|
217
227
|
spec/spec/expectations/wrap_expectation_spec.rb
|
218
228
|
spec/spec/interop/test/unit/resources/spec_that_fails.rb
|
219
229
|
spec/spec/interop/test/unit/resources/spec_that_passes.rb
|
@@ -236,13 +246,13 @@ spec/spec/matchers/description_generation_spec.rb
|
|
236
246
|
spec/spec/matchers/eql_spec.rb
|
237
247
|
spec/spec/matchers/equal_spec.rb
|
238
248
|
spec/spec/matchers/exist_spec.rb
|
239
|
-
spec/spec/matchers/handler_spec.rb
|
240
249
|
spec/spec/matchers/has_spec.rb
|
241
250
|
spec/spec/matchers/have_spec.rb
|
242
251
|
spec/spec/matchers/include_spec.rb
|
243
252
|
spec/spec/matchers/match_array_spec.rb
|
244
253
|
spec/spec/matchers/match_spec.rb
|
245
254
|
spec/spec/matchers/matcher_methods_spec.rb
|
255
|
+
spec/spec/matchers/matcher_spec.rb
|
246
256
|
spec/spec/matchers/operator_matcher_spec.rb
|
247
257
|
spec/spec/matchers/raise_error_spec.rb
|
248
258
|
spec/spec/matchers/respond_to_spec.rb
|
data/README.txt
CHANGED
data/Rakefile
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
3
|
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
4
|
-
require 'rubygems'
|
5
4
|
require 'hoe'
|
6
5
|
require 'spec/version'
|
7
6
|
require 'spec/rake/spectask'
|
@@ -22,6 +21,7 @@ Hoe.new('rspec', Spec::VERSION::STRING) do |p|
|
|
22
21
|
p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
|
23
22
|
p.extra_dev_deps = [["cucumber",">= 0.1.13"]]
|
24
23
|
p.remote_rdoc_dir = "rspec/#{Spec::VERSION::STRING}"
|
24
|
+
p.rspec_options = ['--options', 'spec/spec.opts']
|
25
25
|
end
|
26
26
|
|
27
27
|
['audit','test','test_deps','default','post_blog'].each do |task|
|
@@ -36,12 +36,6 @@ load File.dirname(__FILE__) + '/resources/rake/verify_rcov.rake'
|
|
36
36
|
|
37
37
|
task :default => [:verify_rcov, :features]
|
38
38
|
|
39
|
-
desc "Run all specs"
|
40
|
-
Spec::Rake::SpecTask.new do |t|
|
41
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
42
|
-
t.spec_opts = ['--options', 'spec/spec.opts']
|
43
|
-
end
|
44
|
-
|
45
39
|
namespace :spec do
|
46
40
|
desc "Run all specs with rcov"
|
47
41
|
Spec::Rake::SpecTask.new('rcov') do |t|
|
@@ -98,11 +92,6 @@ namespace :update do
|
|
98
92
|
task :manifest do
|
99
93
|
system %q[touch Manifest.txt; rake check_manifest | grep -v "(in " | patch]
|
100
94
|
end
|
101
|
-
|
102
|
-
desc "update the gemspec"
|
103
|
-
task :gemspec do
|
104
|
-
system %q[rake debug_gem | grep -v "(in " | grep -v "else" | grep -v "s.add_dependency(%q<hoe" | grep -v "s.add_dependency(%q<cuc" > `basename \\`pwd\\``.gemspec]
|
105
|
-
end
|
106
95
|
end
|
107
96
|
|
108
97
|
task :clobber => :clobber_tmp
|
data/Upgrade.markdown
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# Upgrade to rspec-1.1.99.x (pre rspec-1.2)
|
2
|
+
|
3
|
+
## What's Changed
|
4
|
+
|
5
|
+
### WARNINGS
|
6
|
+
|
7
|
+
* If you use the ruby command to run specs instead of the spec command, you'll
|
8
|
+
need to require 'spec/autorun' or they won't run. This won't affect you if
|
9
|
+
you use the spec command or the Spec::Rake::SpecTask that ships with RSpec.
|
10
|
+
|
11
|
+
* require 'spec/test/unit' to invoke test/unit interop if you're using
|
12
|
+
RSpec's core (this is handled implicitly with spec-rails)
|
13
|
+
|
14
|
+
* setup and teardown are gone - use before and after instead
|
15
|
+
|
16
|
+
* you can still use setup and teardown if you're using
|
17
|
+
Test::Unit::TestCase as the base ExampleGroup class (which is implicit
|
18
|
+
in rspec-rails)
|
19
|
+
|
20
|
+
* The matcher protocol has been improved. The old protocol is still
|
21
|
+
supported, so as long as you're not monkey patching rspec's built-in
|
22
|
+
matchers, or using extension libraries that do, this should not affect
|
23
|
+
you. If you run into trouble, you'll just need to change:
|
24
|
+
|
25
|
+
* ``failure_message => failure_message_for_should``
|
26
|
+
* ``negative_failure_message => failure_message_for_should_not``
|
27
|
+
|
28
|
+
* All references to rubygems have been removed from within rspec's code.
|
29
|
+
|
30
|
+
* See Ryan Tomayko's http://gist.github.com/54177 for rationale and
|
31
|
+
suggestions on alternative approaches to loading rubygems
|
32
|
+
|
33
|
+
## What's new
|
34
|
+
|
35
|
+
### Ruby 1.9
|
36
|
+
|
37
|
+
RSpec (core only - not rails yet) now works with Ruby 1.9.1
|
38
|
+
|
39
|
+
### Improved heckle integration
|
40
|
+
|
41
|
+
RSpec works with heckle again! Gotta use heckle >= 1.4.2 for this to work
|
42
|
+
though.
|
43
|
+
|
44
|
+
[sudo] gem install heckle --version ">=1.4.2"
|
45
|
+
spec spec/game/mastermind.rb --heckle Game::Mastermind
|
46
|
+
|
47
|
+
### New Matcher DSL
|
48
|
+
|
49
|
+
We've added a new DSL for generating custom matchers very simply and cleanly.
|
50
|
+
We'll still support the simple_matcher method, so never fear if you're using
|
51
|
+
that, but we recommend that you start developing your new matchers with this
|
52
|
+
new syntax.
|
53
|
+
|
54
|
+
Spec::Matchers.create do :be_a_multiple_of |smaller|
|
55
|
+
match do |bigger|
|
56
|
+
bigger % smaller == 0
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
9.should be_a_multiple_of(3)
|
61
|
+
|
62
|
+
See ``features/matchers/create_matcher_.feature`` for more examples
|
@@ -0,0 +1,115 @@
|
|
1
|
+
Feature: custom matcher shortcut
|
2
|
+
|
3
|
+
In order to express my domain clearly in my code examples
|
4
|
+
As an RSpec user
|
5
|
+
I want a shortcut for create custom matchers
|
6
|
+
|
7
|
+
Scenario: creating a matcher with default messages
|
8
|
+
Given the following spec:
|
9
|
+
"""
|
10
|
+
Spec::Matchers.create :be_a_multiple_of do |expected|
|
11
|
+
match do |actual|
|
12
|
+
actual % expected == 0
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 9 do
|
17
|
+
it {should be_a_multiple_of(3)}
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 9 do
|
21
|
+
it {should_not be_a_multiple_of(4)}
|
22
|
+
end
|
23
|
+
|
24
|
+
# fail intentionally to generate expected output
|
25
|
+
describe 9 do
|
26
|
+
it {should be_a_multiple_of(4)}
|
27
|
+
end
|
28
|
+
|
29
|
+
# fail intentionally to generate expected output
|
30
|
+
describe 9 do
|
31
|
+
it {should_not be_a_multiple_of(3)}
|
32
|
+
end
|
33
|
+
|
34
|
+
"""
|
35
|
+
When I run it with the spec command --format specdoc
|
36
|
+
Then the exit code should be 256
|
37
|
+
|
38
|
+
And the stdout should match "should be a multiple of 3"
|
39
|
+
And the stdout should match "should not be a multiple of 4"
|
40
|
+
And the stdout should match "should be a multiple of 4 (FAILED - 1)"
|
41
|
+
And the stdout should match "should not be a multiple of 3 (FAILED - 2)"
|
42
|
+
|
43
|
+
And the stdout should match "4 examples, 2 failures"
|
44
|
+
And the stdout should match "expected 9 to be a multiple of 4"
|
45
|
+
And the stdout should match "expected 9 not to be a multiple of 3"
|
46
|
+
|
47
|
+
Scenario: overriding the failure_message_for_should
|
48
|
+
Given the following spec:
|
49
|
+
"""
|
50
|
+
Spec::Matchers.create :be_a_multiple_of do |expected|
|
51
|
+
match do |actual|
|
52
|
+
actual % expected == 0
|
53
|
+
end
|
54
|
+
failure_message_for_should do |actual|
|
55
|
+
"expected that #{actual} would be a multiple of #{expected}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# fail intentionally to generate expected output
|
60
|
+
describe 9 do
|
61
|
+
it {should be_a_multiple_of(4)}
|
62
|
+
end
|
63
|
+
"""
|
64
|
+
When I run it with the spec command
|
65
|
+
Then the exit code should be 256
|
66
|
+
And the stdout should match "1 example, 1 failure"
|
67
|
+
And the stdout should match "expected that 9 would be a multiple of 4"
|
68
|
+
|
69
|
+
Scenario: overriding the failure_message_for_should_not
|
70
|
+
Given the following spec:
|
71
|
+
"""
|
72
|
+
Spec::Matchers.create :be_a_multiple_of do |expected|
|
73
|
+
match do |actual|
|
74
|
+
actual % expected == 0
|
75
|
+
end
|
76
|
+
failure_message_for_should_not do |actual|
|
77
|
+
"expected that #{actual} would not be a multiple of #{expected}"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# fail intentionally to generate expected output
|
82
|
+
describe 9 do
|
83
|
+
it {should_not be_a_multiple_of(3)}
|
84
|
+
end
|
85
|
+
"""
|
86
|
+
When I run it with the spec command
|
87
|
+
Then the exit code should be 256
|
88
|
+
And the stdout should match "1 example, 1 failure"
|
89
|
+
And the stdout should match "expected that 9 would not be a multiple of 3"
|
90
|
+
|
91
|
+
Scenario: overriding the description
|
92
|
+
Given the following spec:
|
93
|
+
"""
|
94
|
+
Spec::Matchers.create :be_a_multiple_of do |expected|
|
95
|
+
match do |actual|
|
96
|
+
actual % expected == 0
|
97
|
+
end
|
98
|
+
description do
|
99
|
+
"be multiple of #{expected}"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe 9 do
|
104
|
+
it {should be_a_multiple_of(3)}
|
105
|
+
end
|
106
|
+
|
107
|
+
describe 9 do
|
108
|
+
it {should_not be_a_multiple_of(4)}
|
109
|
+
end
|
110
|
+
"""
|
111
|
+
When I run it with the spec command --format specdoc
|
112
|
+
Then the exit code should be 0
|
113
|
+
And the stdout should match "2 examples, 0 failures"
|
114
|
+
And the stdout should match "should be multiple of 3"
|
115
|
+
And the stdout should match "should not be multiple of 4"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Feature: Spec and test together
|
2
|
+
|
3
|
+
As an RSpec user
|
4
|
+
I want to use stubs and mocks together
|
5
|
+
|
6
|
+
Scenario: stub in before
|
7
|
+
Given the following spec:
|
8
|
+
"""
|
9
|
+
describe "a stub in before" do
|
10
|
+
before(:each) do
|
11
|
+
@messenger = mock('messenger').as_null_object
|
12
|
+
end
|
13
|
+
|
14
|
+
it "a" do
|
15
|
+
@messenger.should_receive(:foo).with('first')
|
16
|
+
@messenger.foo('second')
|
17
|
+
@messenger.foo('third')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
"""
|
21
|
+
When I run it with the spec command --format nested
|
22
|
+
Then the stdout should match "expected :foo with (\"first\") but received it with ([\"second\"], [\"third\"])"
|
@@ -0,0 +1,81 @@
|
|
1
|
+
Feature: pending examples
|
2
|
+
|
3
|
+
RSpec offers three ways to indicate that an example is disabled pending
|
4
|
+
some action.
|
5
|
+
|
6
|
+
Scenario: pending implementation
|
7
|
+
Given the following spec:
|
8
|
+
"""
|
9
|
+
describe "an example" do
|
10
|
+
it "has not yet been implemented"
|
11
|
+
end
|
12
|
+
"""
|
13
|
+
When I run it with the spec command
|
14
|
+
Then the exit code should be 0
|
15
|
+
And the stdout should match "1 example, 0 failures, 1 pending"
|
16
|
+
And the stdout should match "Not Yet Implemented"
|
17
|
+
And the stdout should match "current_example.rb:2"
|
18
|
+
|
19
|
+
Scenario: pending implementation with spec/test/unit
|
20
|
+
Given the following spec:
|
21
|
+
"""
|
22
|
+
require 'spec/test/unit'
|
23
|
+
describe "an example" do
|
24
|
+
it "has not yet been implemented"
|
25
|
+
end
|
26
|
+
"""
|
27
|
+
When I run it with the spec command
|
28
|
+
Then the exit code should be 0
|
29
|
+
And the stdout should match "1 example, 0 failures, 1 pending"
|
30
|
+
And the stdout should match "Not Yet Implemented"
|
31
|
+
And the stdout should match "current_example.rb:3"
|
32
|
+
|
33
|
+
Scenario: pending any arbitary reason, with no block
|
34
|
+
Given the following spec:
|
35
|
+
"""
|
36
|
+
describe "an example" do
|
37
|
+
it "is implemented but waiting" do
|
38
|
+
pending("something else getting finished")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
"""
|
42
|
+
When I run it with the spec command
|
43
|
+
Then the exit code should be 0
|
44
|
+
And the stdout should match "1 example, 0 failures, 1 pending"
|
45
|
+
And the stdout should match "(something else getting finished)"
|
46
|
+
And the stdout should match "current_example.rb:3"
|
47
|
+
|
48
|
+
Scenario: pending any arbitary reason, with a block
|
49
|
+
Given the following spec:
|
50
|
+
"""
|
51
|
+
describe "an example" do
|
52
|
+
it "is implemented but waiting" do
|
53
|
+
pending("something else getting finished") do
|
54
|
+
raise "this is the failure"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
"""
|
59
|
+
When I run it with the spec command
|
60
|
+
Then the exit code should be 0
|
61
|
+
And the stdout should match "1 example, 0 failures, 1 pending"
|
62
|
+
And the stdout should match "(something else getting finished)"
|
63
|
+
And the stdout should match "current_example.rb:3"
|
64
|
+
|
65
|
+
Scenario: pending any arbitary reason, with a block that passes
|
66
|
+
Given the following spec:
|
67
|
+
"""
|
68
|
+
describe "an example" do
|
69
|
+
it "is implemented but waiting" do
|
70
|
+
pending("something else getting finished") do
|
71
|
+
true.should be(true)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
"""
|
76
|
+
When I run it with the spec command
|
77
|
+
Then the exit code should be 256
|
78
|
+
And the stdout should match "1 example, 1 failure"
|
79
|
+
And the stdout should match "FIXED"
|
80
|
+
And the stdout should match "Expected pending 'something else getting finished' to fail. No Error was raised."
|
81
|
+
And the stdout should match "current_example.rb:3"
|