rspec-core 2.0.0.a9 → 2.0.0.a10
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/VERSION +1 -1
- data/features/command_line/example_name_option.feature +14 -14
- data/features/command_line/line_number_appended_to_path.feature +12 -12
- data/features/command_line/line_number_option.feature +8 -8
- data/features/configuration/spec_opts.feature +3 -3
- data/features/example_groups/describe_aliases.feature +5 -2
- data/features/example_groups/nested_groups.feature +3 -3
- data/features/hooks/around_hook.feature +2 -2
- data/features/hooks/before_and_after_hooks.feature +6 -6
- data/features/hooks/halt.feature +1 -1
- data/features/mock_framework_integration/use_flexmock.feature +3 -3
- data/features/mock_framework_integration/use_mocha.feature +3 -3
- data/features/mock_framework_integration/use_rr.feature +3 -3
- data/features/mock_framework_integration/use_rspec.feature +2 -2
- data/features/mocks/block_local_expectations.feature +2 -2
- data/features/mocks/mix_stubs_and_mocks.feature +1 -1
- data/features/subject/explicit_subject.feature +4 -4
- data/features/subject/implicit_subject.feature +4 -4
- data/features/support/env.rb +2 -85
- metadata +46 -25
- data/features/step_definitions/running_rspec_steps.rb +0 -39
- data/features/support/matchers/smart_match.rb +0 -33
- data/rspec-core.gemspec +0 -236
data/.gitignore
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.
|
1
|
+
2.0.0.a10
|
@@ -26,29 +26,29 @@ Feature: example name option
|
|
26
26
|
"""
|
27
27
|
|
28
28
|
Scenario: no matches
|
29
|
-
When I run "
|
30
|
-
Then
|
29
|
+
When I run "rspec . --example nothing_like_this"
|
30
|
+
Then I should see "0 examples, 0 failures"
|
31
31
|
|
32
32
|
Scenario: all matches
|
33
|
-
When I run "
|
34
|
-
Then
|
33
|
+
When I run "rspec . --example example"
|
34
|
+
Then I should see "4 examples, 0 failures"
|
35
35
|
|
36
36
|
Scenario: one match in each file
|
37
|
-
When I run "
|
38
|
-
Then
|
37
|
+
When I run "rspec . --example 'first example'"
|
38
|
+
Then I should see "2 examples, 0 failures"
|
39
39
|
|
40
40
|
Scenario: one match in one file
|
41
|
-
When I run "
|
42
|
-
Then
|
41
|
+
When I run "rspec . --example 'first example in first group'"
|
42
|
+
Then I should see "1 example, 0 failures"
|
43
43
|
|
44
44
|
Scenario: one match in one file using regexp
|
45
|
-
When I run "
|
46
|
-
Then
|
45
|
+
When I run "rspec . --example 'first .* first example'"
|
46
|
+
Then I should see "1 example, 0 failures"
|
47
47
|
|
48
48
|
Scenario: all examples in one group
|
49
|
-
When I run "
|
50
|
-
Then
|
49
|
+
When I run "rspec . --example 'first group'"
|
50
|
+
Then I should see "2 examples, 0 failures"
|
51
51
|
|
52
52
|
Scenario: one match in one file with group name
|
53
|
-
When I run "
|
54
|
-
Then
|
53
|
+
When I run "rspec . --example 'second group first example'"
|
54
|
+
Then I should see "1 example, 0 failures"
|
@@ -21,19 +21,19 @@ Feature: line number appended to file path
|
|
21
21
|
"""
|
22
22
|
|
23
23
|
Scenario: two examples - both examples from the group declaration
|
24
|
-
When I run "
|
25
|
-
Then
|
26
|
-
And
|
27
|
-
And
|
24
|
+
When I run "rspec example_spec.rb:1 --format doc"
|
25
|
+
Then I should see "2 examples, 0 failures"
|
26
|
+
And I should see "has a second example"
|
27
|
+
And I should see "has a first example"
|
28
28
|
|
29
29
|
Scenario: two examples - first example on declaration line
|
30
|
-
When I run "
|
31
|
-
Then
|
32
|
-
And
|
33
|
-
But the stdout should not
|
30
|
+
When I run "rspec example_spec.rb:3 --format doc"
|
31
|
+
Then I should see "1 example, 0 failures"
|
32
|
+
And I should see "has a first example"
|
33
|
+
But the stdout should not contain "has a second example"
|
34
34
|
|
35
35
|
Scenario: two examples - second example on declaration line
|
36
|
-
When I run "
|
37
|
-
Then
|
38
|
-
And
|
39
|
-
But the stdout should not
|
36
|
+
When I run "rspec example_spec.rb:7 --format doc"
|
37
|
+
Then I should see "1 example, 0 failures"
|
38
|
+
And I should see "has a second example"
|
39
|
+
But the stdout should not contain "has a first example"
|
@@ -20,10 +20,10 @@ Feature: line number option
|
|
20
20
|
|
21
21
|
end
|
22
22
|
"""
|
23
|
-
When I run "
|
24
|
-
Then
|
25
|
-
Then
|
26
|
-
But the stdout should not
|
23
|
+
When I run "rspec example_spec.rb --line 5 --format doc"
|
24
|
+
Then I should see "1 example, 0 failures"
|
25
|
+
Then I should see "should be > 8"
|
26
|
+
But the stdout should not contain "should be < 10"
|
27
27
|
|
28
28
|
Scenario: one liner
|
29
29
|
Given a file named "example_spec.rb" with:
|
@@ -38,7 +38,7 @@ Feature: line number option
|
|
38
38
|
|
39
39
|
end
|
40
40
|
"""
|
41
|
-
When I run "
|
42
|
-
Then
|
43
|
-
Then
|
44
|
-
But the stdout should not
|
41
|
+
When I run "rspec example_spec.rb --line 5 --format doc"
|
42
|
+
Then I should see "1 example, 0 failures"
|
43
|
+
Then I should see "should be > 8"
|
44
|
+
But the stdout should not contain "should be < 10"
|
@@ -28,7 +28,7 @@ Feature: spec/spec.opts
|
|
28
28
|
end
|
29
29
|
"""
|
30
30
|
When I run "rspec spec/example_spec.rb"
|
31
|
-
Then
|
31
|
+
Then I should see "1 example, 0 failures"
|
32
32
|
|
33
33
|
Scenario: color set in spec/spec.opts
|
34
34
|
Given a file named "spec/spec.opts" with:
|
@@ -48,7 +48,7 @@ Feature: spec/spec.opts
|
|
48
48
|
end
|
49
49
|
"""
|
50
50
|
When I run "rspec spec/example_spec.rb"
|
51
|
-
Then
|
51
|
+
Then I should see "1 example, 0 failures"
|
52
52
|
|
53
53
|
@wip
|
54
54
|
Scenario: formatter set in both (spec.opts wins)
|
@@ -74,5 +74,5 @@ Feature: spec/spec.opts
|
|
74
74
|
end
|
75
75
|
"""
|
76
76
|
When I run "rspec spec/example_spec.rb"
|
77
|
-
Then
|
77
|
+
Then I should see "1 example, 0 failures"
|
78
78
|
|
@@ -18,5 +18,8 @@ Feature: Nested example groups
|
|
18
18
|
end
|
19
19
|
"""
|
20
20
|
When I run "rspec context_instead_of_describe_spec.rb -fn"
|
21
|
-
Then
|
22
|
-
|
21
|
+
Then I should see:
|
22
|
+
"""
|
23
|
+
Using context
|
24
|
+
with nested context
|
25
|
+
"""
|
@@ -22,6 +22,6 @@ Feature: Nested example groups
|
|
22
22
|
end
|
23
23
|
"""
|
24
24
|
When I run "rspec nested_example_groups.rb -fdoc"
|
25
|
-
Then
|
26
|
-
And
|
27
|
-
And
|
25
|
+
Then I should see /^Some Object/
|
26
|
+
And I should see /^\s+with some more context/
|
27
|
+
And I should see /^\s+with some other context/
|
@@ -32,5 +32,5 @@ Feature: around hook
|
|
32
32
|
end
|
33
33
|
"""
|
34
34
|
When I run "rspec around_each_in_example_group_spec.rb"
|
35
|
-
Then the stderr should not
|
36
|
-
Then
|
35
|
+
Then the stderr should not contain "NoMethodError"
|
36
|
+
Then I should see "2 examples, 0 failures"
|
@@ -60,7 +60,7 @@ Feature: before and after hooks
|
|
60
60
|
end
|
61
61
|
"""
|
62
62
|
When I run "rspec before_each_in_example_group_spec.rb"
|
63
|
-
Then
|
63
|
+
Then I should see "3 examples, 0 failures"
|
64
64
|
|
65
65
|
Scenario: define before(:all) block in example group
|
66
66
|
Given a file named "before_all_in_example_group_spec.rb" with:
|
@@ -94,7 +94,7 @@ Feature: before and after hooks
|
|
94
94
|
end
|
95
95
|
"""
|
96
96
|
When I run "rspec before_all_in_example_group_spec.rb"
|
97
|
-
Then
|
97
|
+
Then I should see "3 examples, 0 failures"
|
98
98
|
|
99
99
|
@wip
|
100
100
|
Scenario: define before and after blocks in configuration
|
@@ -132,8 +132,8 @@ Feature: before and after hooks
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
"""
|
135
|
-
When I run "
|
136
|
-
Then
|
135
|
+
When I run "rspec befores_in_configuration_spec.rb"
|
136
|
+
Then I should see "3 examples, 0 failures"
|
137
137
|
|
138
138
|
@wip
|
139
139
|
Scenario: before/after blocks are run in order
|
@@ -172,6 +172,6 @@ Feature: before and after hooks
|
|
172
172
|
end
|
173
173
|
end
|
174
174
|
"""
|
175
|
-
When I run "
|
176
|
-
Then
|
175
|
+
When I run "rspec ensure_block_order_spec.rb"
|
176
|
+
Then I should see /before suite\nbefore all\nbefore each\nafter each\n\.after all\n.*after suite/m
|
177
177
|
|
data/features/hooks/halt.feature
CHANGED
@@ -18,6 +18,6 @@ Feature: mock with flexmock
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
"""
|
21
|
-
When I run "
|
22
|
-
Then
|
23
|
-
And the exit
|
21
|
+
When I run "rspec flexmock_example_spec.rb"
|
22
|
+
Then I should see "1 example, 0 failures"
|
23
|
+
And the exit status should be 0
|
@@ -18,6 +18,6 @@ Feature: mock with mocha
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
"""
|
21
|
-
When I run "
|
22
|
-
Then
|
23
|
-
And the exit
|
21
|
+
When I run "rspec mocha_example_spec.rb"
|
22
|
+
Then I should see "1 example, 0 failures"
|
23
|
+
And the exit status should be 0
|
@@ -18,6 +18,6 @@ Feature: mock with rr
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
"""
|
21
|
-
When I run "
|
22
|
-
Then
|
23
|
-
And the exit
|
21
|
+
When I run "rspec rr_example_spec.rb"
|
22
|
+
Then I should see "1 example, 0 failures"
|
23
|
+
And the exit status should be 0
|
@@ -39,7 +39,7 @@ Feature: block local expectations
|
|
39
39
|
end
|
40
40
|
"""
|
41
41
|
When I run "rspec account_passing_spec.rb"
|
42
|
-
Then
|
42
|
+
Then I should see "1 example, 0 failures"
|
43
43
|
|
44
44
|
Scenario: failing example
|
45
45
|
|
@@ -65,4 +65,4 @@ Feature: block local expectations
|
|
65
65
|
"""
|
66
66
|
|
67
67
|
When I run "rspec account_failing_spec.rb"
|
68
|
-
Then
|
68
|
+
Then I should see "1 example, 1 failure"
|
@@ -14,8 +14,8 @@ Feature: explicit subject
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
"""
|
17
|
-
When I run "
|
18
|
-
Then
|
17
|
+
When I run "rspec top_level_subject_spec.rb"
|
18
|
+
Then I should see "1 example, 0 failures"
|
19
19
|
|
20
20
|
Scenario: subject in a nested group
|
21
21
|
Given a file named "nested_subject_spec.rb" with:
|
@@ -31,5 +31,5 @@ Feature: explicit subject
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
"""
|
34
|
-
When I run "
|
35
|
-
Then
|
34
|
+
When I run "rspec nested_subject_spec.rb"
|
35
|
+
Then I should see "1 example, 0 failures"
|
@@ -15,8 +15,8 @@ Feature: implicit subject
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
"""
|
18
|
-
When I run "
|
19
|
-
Then
|
18
|
+
When I run "rspec top_level_subject_spec.rb"
|
19
|
+
Then I should see "1 example, 0 failures"
|
20
20
|
|
21
21
|
Scenario: subject in a nested group
|
22
22
|
Given a file named "nested_subject_spec.rb" with:
|
@@ -31,5 +31,5 @@ Feature: implicit subject
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
"""
|
34
|
-
When I run "
|
35
|
-
Then
|
34
|
+
When I run "rspec nested_subject_spec.rb"
|
35
|
+
Then I should see "1 example, 0 failures"
|
data/features/support/env.rb
CHANGED
@@ -1,85 +1,2 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
require 'forwardable'
|
5
|
-
require 'tempfile'
|
6
|
-
require 'spec/ruby_forker'
|
7
|
-
require 'features/support/matchers/smart_match'
|
8
|
-
|
9
|
-
class RspecWorld
|
10
|
-
include Rspec::Expectations
|
11
|
-
include Rspec::Matchers
|
12
|
-
include RubyForker
|
13
|
-
|
14
|
-
extend Forwardable
|
15
|
-
def_delegators RspecWorld, :working_dir, :spec_command
|
16
|
-
|
17
|
-
def self.working_dir
|
18
|
-
@working_dir ||= File.expand_path('../../../tmp/cucumber-generated-files', __FILE__)
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.spec_command
|
22
|
-
@spec_command ||= File.expand_path('../../../bin/rspec', __FILE__)
|
23
|
-
end
|
24
|
-
|
25
|
-
def spec(args)
|
26
|
-
ruby("#{spec_command} #{args}")
|
27
|
-
end
|
28
|
-
|
29
|
-
def create_dir(dirname)
|
30
|
-
FileUtils.mkdir_p File.join(working_dir, dirname)
|
31
|
-
end
|
32
|
-
|
33
|
-
def create_file(file_name, contents)
|
34
|
-
file_path = File.join(working_dir, file_name)
|
35
|
-
File.open(file_path, "w") { |f| f << contents }
|
36
|
-
end
|
37
|
-
|
38
|
-
def last_stdout
|
39
|
-
@stdout
|
40
|
-
end
|
41
|
-
|
42
|
-
def last_stderr
|
43
|
-
@stderr
|
44
|
-
end
|
45
|
-
|
46
|
-
def last_exit_code
|
47
|
-
@exit_code
|
48
|
-
end
|
49
|
-
|
50
|
-
def rspec_libs
|
51
|
-
"-I #{RSPEC_LIB} -I #{working_dir}"
|
52
|
-
end
|
53
|
-
|
54
|
-
# it seems like this, and the last_* methods, could be moved into RubyForker-- is that being used anywhere but the features?
|
55
|
-
def ruby(args)
|
56
|
-
stderr_file = Tempfile.new('rspec')
|
57
|
-
stderr_file.close
|
58
|
-
|
59
|
-
Dir.chdir(working_dir) do
|
60
|
-
File.open('load_paths.rb', 'w') do |f|
|
61
|
-
f.write <<-CONTENT
|
62
|
-
$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__))
|
63
|
-
$LOAD_PATH.unshift(File.expand_path('../../../../rspec-expectations/lib', __FILE__))
|
64
|
-
$LOAD_PATH.unshift(File.expand_path('../../../../rspec-mocks/lib', __FILE__))
|
65
|
-
CONTENT
|
66
|
-
end
|
67
|
-
cmd = "-rrubygems -rload_paths.rb #{rspec_libs} #{args}"
|
68
|
-
# p cmd
|
69
|
-
@stdout = super(cmd, stderr_file.path)
|
70
|
-
end
|
71
|
-
@stderr = IO.read(stderr_file.path)
|
72
|
-
p @stderr unless @stderr == ""
|
73
|
-
@exit_code = $?.to_i
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
Before do
|
79
|
-
FileUtils.rm_rf RspecWorld.working_dir if test ?d, RspecWorld.working_dir
|
80
|
-
FileUtils.mkdir_p RspecWorld.working_dir
|
81
|
-
end
|
82
|
-
|
83
|
-
World do
|
84
|
-
RspecWorld.new
|
85
|
-
end
|
1
|
+
require 'aruba'
|
2
|
+
require 'rspec/expectations'
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- a10
|
10
|
+
version: 2.0.0.a10
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Chad Humphries
|
@@ -10,39 +16,53 @@ autorequire:
|
|
10
16
|
bindir: bin
|
11
17
|
cert_chain: []
|
12
18
|
|
13
|
-
date: 2010-02-
|
19
|
+
date: 2010-02-27 00:00:00 -06:00
|
14
20
|
default_executable:
|
15
21
|
dependencies:
|
16
22
|
- !ruby/object:Gem::Dependency
|
17
23
|
name: rspec-expectations
|
18
|
-
|
19
|
-
|
20
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
26
|
requirements:
|
22
27
|
- - ">="
|
23
28
|
- !ruby/object:Gem::Version
|
24
|
-
|
25
|
-
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 0
|
32
|
+
- 0
|
33
|
+
- a10
|
34
|
+
version: 2.0.0.a10
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
26
37
|
- !ruby/object:Gem::Dependency
|
27
38
|
name: rspec-mocks
|
28
|
-
|
29
|
-
|
30
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
41
|
requirements:
|
32
42
|
- - ">="
|
33
43
|
- !ruby/object:Gem::Version
|
34
|
-
|
35
|
-
|
44
|
+
segments:
|
45
|
+
- 2
|
46
|
+
- 0
|
47
|
+
- 0
|
48
|
+
- a10
|
49
|
+
version: 2.0.0.a10
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
36
52
|
- !ruby/object:Gem::Dependency
|
37
53
|
name: cucumber
|
38
|
-
|
39
|
-
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
56
|
requirements:
|
42
57
|
- - ">="
|
43
58
|
- !ruby/object:Gem::Version
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
- 5
|
62
|
+
- 3
|
44
63
|
version: 0.5.3
|
45
|
-
|
64
|
+
type: :development
|
65
|
+
version_requirements: *id003
|
46
66
|
description: Rspec runner and example group classes
|
47
67
|
email: dchelimsky@gmail.com;chad.humphries@gmail.com
|
48
68
|
executables:
|
@@ -143,11 +163,9 @@ files:
|
|
143
163
|
- features/mock_framework_integration/use_rspec.feature
|
144
164
|
- features/mocks/block_local_expectations.feature
|
145
165
|
- features/mocks/mix_stubs_and_mocks.feature
|
146
|
-
- features/step_definitions/running_rspec_steps.rb
|
147
166
|
- features/subject/explicit_subject.feature
|
148
167
|
- features/subject/implicit_subject.feature
|
149
168
|
- features/support/env.rb
|
150
|
-
- features/support/matchers/smart_match.rb
|
151
169
|
- lib/rspec/autorun.rb
|
152
170
|
- lib/rspec/core.rb
|
153
171
|
- lib/rspec/core/advice.rb
|
@@ -179,7 +197,6 @@ files:
|
|
179
197
|
- lib/rspec/core/shared_example_group_kernel_extensions.rb
|
180
198
|
- lib/rspec/core/version.rb
|
181
199
|
- lib/rspec/core/world.rb
|
182
|
-
- rspec-core.gemspec
|
183
200
|
- script/console
|
184
201
|
- spec/rspec/core/command_line_options_spec.rb
|
185
202
|
- spec/rspec/core/configuration_spec.rb
|
@@ -213,9 +230,9 @@ licenses: []
|
|
213
230
|
post_install_message: |
|
214
231
|
**************************************************
|
215
232
|
|
216
|
-
Thank you for installing rspec-core-2.0.0.
|
233
|
+
Thank you for installing rspec-core-2.0.0.a10
|
217
234
|
|
218
|
-
The 'a' in 2.0.0.
|
235
|
+
The 'a' in 2.0.0.a10 means this is alpha software.
|
219
236
|
If you are looking for a supported production release,
|
220
237
|
please "gem install rspec" (without --pre).
|
221
238
|
|
@@ -229,21 +246,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
229
246
|
requirements:
|
230
247
|
- - ">="
|
231
248
|
- !ruby/object:Gem::Version
|
249
|
+
segments:
|
250
|
+
- 0
|
232
251
|
version: "0"
|
233
|
-
version:
|
234
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
253
|
requirements:
|
236
254
|
- - ">"
|
237
255
|
- !ruby/object:Gem::Version
|
256
|
+
segments:
|
257
|
+
- 1
|
258
|
+
- 3
|
259
|
+
- 1
|
238
260
|
version: 1.3.1
|
239
|
-
version:
|
240
261
|
requirements: []
|
241
262
|
|
242
263
|
rubyforge_project: rspec
|
243
|
-
rubygems_version: 1.3.
|
264
|
+
rubygems_version: 1.3.6
|
244
265
|
signing_key:
|
245
266
|
specification_version: 3
|
246
|
-
summary: rspec-core-2.0.0.
|
267
|
+
summary: rspec-core-2.0.0.a10
|
247
268
|
test_files:
|
248
269
|
- spec/rspec/core/command_line_options_spec.rb
|
249
270
|
- spec/rspec/core/configuration_spec.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
Given /^a directory named "([^"]+)"$/ do |dirname|
|
2
|
-
create_dir(dirname)
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^a file named "([^"]+)" with:$/ do |file_name, code|
|
6
|
-
create_file(file_name, code)
|
7
|
-
end
|
8
|
-
|
9
|
-
When /^I run "r?spec ([^"]+)"$/ do |file_and_args|
|
10
|
-
spec(file_and_args)
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I run "ruby ([^"]+)"$/ do |file_and_args|
|
14
|
-
ruby(file_and_args)
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^the (.*) should match (.*)$/ do |stream, string_or_regex|
|
18
|
-
written = case(stream)
|
19
|
-
when 'stdout' then last_stdout
|
20
|
-
when 'stderr' then last_stderr
|
21
|
-
else raise "Unknown stream: #{stream}"
|
22
|
-
end
|
23
|
-
written.should smart_match(string_or_regex)
|
24
|
-
end
|
25
|
-
|
26
|
-
Then /^the (.*) should not match (.*)$/ do |stream, string_or_regex|
|
27
|
-
written = case(stream)
|
28
|
-
when 'stdout' then last_stdout
|
29
|
-
when 'stderr' then last_stderr
|
30
|
-
else raise "Unknown stream: #{stream}"
|
31
|
-
end
|
32
|
-
written.should_not smart_match(string_or_regex)
|
33
|
-
end
|
34
|
-
|
35
|
-
Then /^the exit code should be (\d+)$/ do |exit_code|
|
36
|
-
if last_exit_code != exit_code.to_i
|
37
|
-
raise "Did not exit with #{exit_code}, but with #{last_exit_code}. Standard error:\n#{last_stderr}"
|
38
|
-
end
|
39
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'rspec/expectations'
|
2
|
-
|
3
|
-
Rspec::Matchers.define :smart_match do |expected|
|
4
|
-
def regexp?
|
5
|
-
/^\/.*\/?$/
|
6
|
-
end
|
7
|
-
|
8
|
-
def quoted?
|
9
|
-
/^".*"$/
|
10
|
-
end
|
11
|
-
|
12
|
-
match do |actual|
|
13
|
-
case expected
|
14
|
-
when regexp?
|
15
|
-
actual =~ eval(expected)
|
16
|
-
when quoted?
|
17
|
-
actual.index(eval(expected))
|
18
|
-
else # multi-line string
|
19
|
-
actual.index(expected)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
failure_message_for_should do |actual|
|
24
|
-
<<-MESSAGE
|
25
|
-
#{'*'*50}
|
26
|
-
got:
|
27
|
-
#{'*'*30}
|
28
|
-
#{actual}
|
29
|
-
#{'*'*50}
|
30
|
-
MESSAGE
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
data/rspec-core.gemspec
DELETED
@@ -1,236 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{rspec-core}
|
8
|
-
s.version = "2.0.0.a9"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Chad Humphries", "David Chelimsky"]
|
12
|
-
s.date = %q{2010-02-25}
|
13
|
-
s.description = %q{Rspec runner and example group classes}
|
14
|
-
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
15
|
-
s.executables = ["rspec", "spec"]
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
"README.markdown"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
".treasure_map.rb",
|
23
|
-
"License.txt",
|
24
|
-
"README.markdown",
|
25
|
-
"Rakefile",
|
26
|
-
"TODO.markdown",
|
27
|
-
"VERSION",
|
28
|
-
"bin/rspec",
|
29
|
-
"bin/spec",
|
30
|
-
"cucumber.yml",
|
31
|
-
"example_specs/failing/README.txt",
|
32
|
-
"example_specs/failing/diffing_spec.rb",
|
33
|
-
"example_specs/failing/failing_implicit_docstrings_example.rb",
|
34
|
-
"example_specs/failing/failure_in_after.rb",
|
35
|
-
"example_specs/failing/failure_in_before.rb",
|
36
|
-
"example_specs/failing/mocking_example.rb",
|
37
|
-
"example_specs/failing/mocking_with_flexmock.rb",
|
38
|
-
"example_specs/failing/mocking_with_mocha.rb",
|
39
|
-
"example_specs/failing/mocking_with_rr.rb",
|
40
|
-
"example_specs/failing/partial_mock_example.rb",
|
41
|
-
"example_specs/failing/pending_example.rb",
|
42
|
-
"example_specs/failing/predicate_example.rb",
|
43
|
-
"example_specs/failing/raising_example.rb",
|
44
|
-
"example_specs/failing/spec_helper.rb",
|
45
|
-
"example_specs/failing/syntax_error_example.rb",
|
46
|
-
"example_specs/failing/team_spec.rb",
|
47
|
-
"example_specs/failing/timeout_behaviour.rb",
|
48
|
-
"example_specs/passing/custom_formatter.rb",
|
49
|
-
"example_specs/passing/custom_matchers.rb",
|
50
|
-
"example_specs/passing/dynamic_spec.rb",
|
51
|
-
"example_specs/passing/file_accessor.rb",
|
52
|
-
"example_specs/passing/file_accessor_spec.rb",
|
53
|
-
"example_specs/passing/filtered_formatter.rb",
|
54
|
-
"example_specs/passing/filtered_formatter_example.rb",
|
55
|
-
"example_specs/passing/greeter_spec.rb",
|
56
|
-
"example_specs/passing/helper_method_example.rb",
|
57
|
-
"example_specs/passing/implicit_docstrings_example.rb",
|
58
|
-
"example_specs/passing/io_processor.rb",
|
59
|
-
"example_specs/passing/io_processor_spec.rb",
|
60
|
-
"example_specs/passing/mocking_example.rb",
|
61
|
-
"example_specs/passing/multi_threaded_example_group_runner.rb",
|
62
|
-
"example_specs/passing/nested_classes_example.rb",
|
63
|
-
"example_specs/passing/options_example.rb",
|
64
|
-
"example_specs/passing/options_formatter.rb",
|
65
|
-
"example_specs/passing/partial_mock_example.rb",
|
66
|
-
"example_specs/passing/pending_example.rb",
|
67
|
-
"example_specs/passing/predicate_example.rb",
|
68
|
-
"example_specs/passing/shared_example_group_example.rb",
|
69
|
-
"example_specs/passing/shared_stack_examples.rb",
|
70
|
-
"example_specs/passing/simple_matcher_example.rb",
|
71
|
-
"example_specs/passing/spec_helper.rb",
|
72
|
-
"example_specs/passing/stack.rb",
|
73
|
-
"example_specs/passing/stack_spec.rb",
|
74
|
-
"example_specs/passing/stack_spec_with_nested_example_groups.rb",
|
75
|
-
"example_specs/passing/stubbing_example.rb",
|
76
|
-
"example_specs/passing/yielding_example.rb",
|
77
|
-
"example_specs/ruby1.9.compatibility/access_to_constants_spec.rb",
|
78
|
-
"example_specs/spec_helper.rb",
|
79
|
-
"features-pending/example_groups/example_group_with_should_methods.feature",
|
80
|
-
"features-pending/example_groups/implicit_docstrings.feature",
|
81
|
-
"features-pending/expectations/expect_change.feature",
|
82
|
-
"features-pending/expectations/expect_error.feature",
|
83
|
-
"features-pending/extensions/custom_example_group.feature",
|
84
|
-
"features-pending/formatters/custom_formatter.feature",
|
85
|
-
"features-pending/heckle/heckle.feature",
|
86
|
-
"features-pending/interop/examples_and_tests_together.feature",
|
87
|
-
"features-pending/interop/rspec_output.feature",
|
88
|
-
"features-pending/interop/test_but_not_test_unit.feature",
|
89
|
-
"features-pending/interop/test_case_with_should_methods.feature",
|
90
|
-
"features-pending/matchers/define_diffable_matcher.feature",
|
91
|
-
"features-pending/matchers/define_matcher_with_fluent_interface.feature",
|
92
|
-
"features-pending/mocks/stub_implementation.feature",
|
93
|
-
"features-pending/pending/pending_examples.feature",
|
94
|
-
"features-pending/runner/specify_line_number.feature",
|
95
|
-
"features/command_line/example_name_option.feature",
|
96
|
-
"features/command_line/line_number_appended_to_path.feature",
|
97
|
-
"features/command_line/line_number_option.feature",
|
98
|
-
"features/configuration/spec_opts.feature",
|
99
|
-
"features/example_groups/describe_aliases.feature",
|
100
|
-
"features/example_groups/nested_groups.feature",
|
101
|
-
"features/hooks/around_hook.feature",
|
102
|
-
"features/hooks/before_and_after_hooks.feature",
|
103
|
-
"features/hooks/halt.feature",
|
104
|
-
"features/mock_framework_integration/use_flexmock.feature",
|
105
|
-
"features/mock_framework_integration/use_mocha.feature",
|
106
|
-
"features/mock_framework_integration/use_rr.feature",
|
107
|
-
"features/mock_framework_integration/use_rspec.feature",
|
108
|
-
"features/mocks/block_local_expectations.feature",
|
109
|
-
"features/mocks/mix_stubs_and_mocks.feature",
|
110
|
-
"features/step_definitions/running_rspec_steps.rb",
|
111
|
-
"features/subject/explicit_subject.feature",
|
112
|
-
"features/subject/implicit_subject.feature",
|
113
|
-
"features/support/env.rb",
|
114
|
-
"features/support/matchers/smart_match.rb",
|
115
|
-
"lib/rspec/autorun.rb",
|
116
|
-
"lib/rspec/core.rb",
|
117
|
-
"lib/rspec/core/advice.rb",
|
118
|
-
"lib/rspec/core/around_proxy.rb",
|
119
|
-
"lib/rspec/core/backward_compatibility.rb",
|
120
|
-
"lib/rspec/core/command_line_options.rb",
|
121
|
-
"lib/rspec/core/configuration.rb",
|
122
|
-
"lib/rspec/core/deprecation.rb",
|
123
|
-
"lib/rspec/core/example.rb",
|
124
|
-
"lib/rspec/core/example_group.rb",
|
125
|
-
"lib/rspec/core/example_group_subject.rb",
|
126
|
-
"lib/rspec/core/formatters.rb",
|
127
|
-
"lib/rspec/core/formatters/base_formatter.rb",
|
128
|
-
"lib/rspec/core/formatters/base_text_formatter.rb",
|
129
|
-
"lib/rspec/core/formatters/documentation_formatter.rb",
|
130
|
-
"lib/rspec/core/formatters/progress_formatter.rb",
|
131
|
-
"lib/rspec/core/kernel_extensions.rb",
|
132
|
-
"lib/rspec/core/load_path.rb",
|
133
|
-
"lib/rspec/core/metadata.rb",
|
134
|
-
"lib/rspec/core/mocking/with_absolutely_nothing.rb",
|
135
|
-
"lib/rspec/core/mocking/with_flexmock.rb",
|
136
|
-
"lib/rspec/core/mocking/with_mocha.rb",
|
137
|
-
"lib/rspec/core/mocking/with_rr.rb",
|
138
|
-
"lib/rspec/core/mocking/with_rspec.rb",
|
139
|
-
"lib/rspec/core/rake_task.rb",
|
140
|
-
"lib/rspec/core/ruby_project.rb",
|
141
|
-
"lib/rspec/core/runner.rb",
|
142
|
-
"lib/rspec/core/shared_example_group.rb",
|
143
|
-
"lib/rspec/core/shared_example_group_kernel_extensions.rb",
|
144
|
-
"lib/rspec/core/version.rb",
|
145
|
-
"lib/rspec/core/world.rb",
|
146
|
-
"rspec-core.gemspec",
|
147
|
-
"script/console",
|
148
|
-
"spec/rspec/core/command_line_options_spec.rb",
|
149
|
-
"spec/rspec/core/configuration_spec.rb",
|
150
|
-
"spec/rspec/core/example_group_spec.rb",
|
151
|
-
"spec/rspec/core/example_group_subject_spec.rb",
|
152
|
-
"spec/rspec/core/example_spec.rb",
|
153
|
-
"spec/rspec/core/formatters/base_formatter_spec.rb",
|
154
|
-
"spec/rspec/core/formatters/documentation_formatter_spec.rb",
|
155
|
-
"spec/rspec/core/formatters/progress_formatter_spec.rb",
|
156
|
-
"spec/rspec/core/kernel_extensions_spec.rb",
|
157
|
-
"spec/rspec/core/metadata_spec.rb",
|
158
|
-
"spec/rspec/core/mocha_spec.rb",
|
159
|
-
"spec/rspec/core/pending_example_spec.rb",
|
160
|
-
"spec/rspec/core/resources/a_bar.rb",
|
161
|
-
"spec/rspec/core/resources/a_foo.rb",
|
162
|
-
"spec/rspec/core/resources/a_spec.rb",
|
163
|
-
"spec/rspec/core/resources/custom_example_group_runner.rb",
|
164
|
-
"spec/rspec/core/resources/utf8_encoded.rb",
|
165
|
-
"spec/rspec/core/ruby_project_spec.rb",
|
166
|
-
"spec/rspec/core/runner_spec.rb",
|
167
|
-
"spec/rspec/core/shared_example_group_spec.rb",
|
168
|
-
"spec/rspec/core/world_spec.rb",
|
169
|
-
"spec/rspec/core_spec.rb",
|
170
|
-
"spec/ruby_forker.rb",
|
171
|
-
"spec/spec_helper.rb",
|
172
|
-
"specs.watchr"
|
173
|
-
]
|
174
|
-
s.homepage = %q{http://github.com/rspec/core}
|
175
|
-
s.post_install_message = %q{**************************************************
|
176
|
-
|
177
|
-
Thank you for installing rspec-core-2.0.0.a9
|
178
|
-
|
179
|
-
The 'a' in 2.0.0.a9 means this is alpha software.
|
180
|
-
If you are looking for a supported production release,
|
181
|
-
please "gem install rspec" (without --pre).
|
182
|
-
|
183
|
-
**************************************************
|
184
|
-
}
|
185
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
186
|
-
s.require_paths = ["lib"]
|
187
|
-
s.rubyforge_project = %q{rspec}
|
188
|
-
s.rubygems_version = %q{1.3.5}
|
189
|
-
s.summary = %q{rspec-core-2.0.0.a9}
|
190
|
-
s.test_files = [
|
191
|
-
"spec/rspec/core/command_line_options_spec.rb",
|
192
|
-
"spec/rspec/core/configuration_spec.rb",
|
193
|
-
"spec/rspec/core/example_group_spec.rb",
|
194
|
-
"spec/rspec/core/example_group_subject_spec.rb",
|
195
|
-
"spec/rspec/core/example_spec.rb",
|
196
|
-
"spec/rspec/core/formatters/base_formatter_spec.rb",
|
197
|
-
"spec/rspec/core/formatters/documentation_formatter_spec.rb",
|
198
|
-
"spec/rspec/core/formatters/progress_formatter_spec.rb",
|
199
|
-
"spec/rspec/core/kernel_extensions_spec.rb",
|
200
|
-
"spec/rspec/core/metadata_spec.rb",
|
201
|
-
"spec/rspec/core/mocha_spec.rb",
|
202
|
-
"spec/rspec/core/pending_example_spec.rb",
|
203
|
-
"spec/rspec/core/resources/a_bar.rb",
|
204
|
-
"spec/rspec/core/resources/a_foo.rb",
|
205
|
-
"spec/rspec/core/resources/a_spec.rb",
|
206
|
-
"spec/rspec/core/resources/custom_example_group_runner.rb",
|
207
|
-
"spec/rspec/core/resources/utf8_encoded.rb",
|
208
|
-
"spec/rspec/core/ruby_project_spec.rb",
|
209
|
-
"spec/rspec/core/runner_spec.rb",
|
210
|
-
"spec/rspec/core/shared_example_group_spec.rb",
|
211
|
-
"spec/rspec/core/world_spec.rb",
|
212
|
-
"spec/rspec/core_spec.rb",
|
213
|
-
"spec/ruby_forker.rb",
|
214
|
-
"spec/spec_helper.rb"
|
215
|
-
]
|
216
|
-
|
217
|
-
if s.respond_to? :specification_version then
|
218
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
219
|
-
s.specification_version = 3
|
220
|
-
|
221
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
222
|
-
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.a9"])
|
223
|
-
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.a9"])
|
224
|
-
s.add_development_dependency(%q<cucumber>, [">= 0.5.3"])
|
225
|
-
else
|
226
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.a9"])
|
227
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.a9"])
|
228
|
-
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
229
|
-
end
|
230
|
-
else
|
231
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.a9"])
|
232
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.a9"])
|
233
|
-
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
234
|
-
end
|
235
|
-
end
|
236
|
-
|