rspec-core 2.0.0.beta.14 → 2.0.0.beta.15
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/Gemfile +3 -3
- data/VERSION +1 -1
- data/lib/rspec/core/configuration.rb +10 -8
- data/lib/rspec/core/example.rb +64 -57
- data/lib/rspec/core/formatters/base_formatter.rb +19 -2
- data/lib/rspec/core/formatters/base_text_formatter.rb +24 -38
- data/lib/rspec/core/formatters/documentation_formatter.rb +10 -18
- data/lib/rspec/core/formatters/progress_formatter.rb +11 -16
- data/rspec-core.gemspec +16 -16
- data/spec/rspec/core/configuration_spec.rb +8 -2
- data/spec/rspec/{core_spec.rb → core/core_spec.rb} +2 -10
- data/spec/rspec/core/example_spec.rb +4 -19
- data/spec/rspec/core/formatters/base_formatter_spec.rb +10 -2
- data/spec/rspec/core/formatters/documentation_formatter_spec.rb +1 -1
- metadata +30 -19
- data/bin/spec +0 -11
data/Gemfile
CHANGED
@@ -4,8 +4,9 @@ gem "bundler"
|
|
4
4
|
gem "rake"
|
5
5
|
gem "jeweler"
|
6
6
|
gem "cucumber"
|
7
|
-
gem "aruba"
|
7
|
+
gem "aruba", :git => "git://github.com/dchelimsky/aruba.git", :branch => "add-gemspec"
|
8
8
|
gem "autotest"
|
9
|
+
gem "watchr"
|
9
10
|
gem "rcov"
|
10
11
|
gem "mocha"
|
11
12
|
gem "rr"
|
@@ -15,7 +16,6 @@ gem "rspec-expectations", :path => "../rspec-expectations"
|
|
15
16
|
gem "rspec-mocks", :path => "../rspec-mocks"
|
16
17
|
if RUBY_VERSION.to_s =~ /1.9.1/
|
17
18
|
gem "ruby-debug19"
|
18
|
-
elsif RUBY_VERSION.to_s =~ /1.9.2/
|
19
|
-
else
|
19
|
+
elsif !(RUBY_VERSION.to_s =~ /1.9.2/)
|
20
20
|
gem "ruby-debug"
|
21
21
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.beta.
|
1
|
+
2.0.0.beta.15
|
@@ -197,18 +197,20 @@ EOM
|
|
197
197
|
alias_method :reporter, :formatter
|
198
198
|
|
199
199
|
def files_or_directories_to_run=(*files)
|
200
|
-
self.files_to_run = files.flatten.
|
200
|
+
self.files_to_run = files.flatten.collect do |file|
|
201
201
|
if File.directory?(file)
|
202
|
-
filename_pattern.split(",").
|
203
|
-
|
202
|
+
filename_pattern.split(",").collect do |pattern|
|
203
|
+
Dir["#{file}/#{pattern.strip}"]
|
204
204
|
end
|
205
205
|
else
|
206
|
-
|
207
|
-
|
208
|
-
|
206
|
+
if file =~ /(\:(\d+))$/
|
207
|
+
self.line_number = $2
|
208
|
+
file.sub($1,'')
|
209
|
+
else
|
210
|
+
file
|
211
|
+
end
|
209
212
|
end
|
210
|
-
|
211
|
-
end
|
213
|
+
end.flatten
|
212
214
|
end
|
213
215
|
|
214
216
|
# E.g. alias_example_to :crazy_slow, :speed => 'crazy_slow' defines
|
data/lib/rspec/core/example.rb
CHANGED
@@ -2,7 +2,7 @@ module RSpec
|
|
2
2
|
module Core
|
3
3
|
class Example
|
4
4
|
|
5
|
-
attr_reader :metadata, :
|
5
|
+
attr_reader :metadata, :options
|
6
6
|
|
7
7
|
def self.delegate_to_metadata(*keys)
|
8
8
|
keys.each do |key|
|
@@ -17,99 +17,106 @@ module RSpec
|
|
17
17
|
|
18
18
|
def initialize(example_group_class, desc, options, example_block=nil)
|
19
19
|
@example_group_class, @options, @example_block = example_group_class, options, example_block
|
20
|
-
@metadata
|
20
|
+
@metadata = @example_group_class.metadata.for_example(desc, options)
|
21
|
+
@exception = nil
|
22
|
+
@in_block = false
|
21
23
|
end
|
22
24
|
|
23
25
|
def example_group
|
24
26
|
@example_group_class
|
25
27
|
end
|
26
28
|
|
29
|
+
def behaviour
|
30
|
+
RSpec.deprecate("behaviour", "example_group")
|
31
|
+
example_group
|
32
|
+
end
|
33
|
+
|
27
34
|
def in_block?
|
28
35
|
@in_block
|
29
36
|
end
|
30
37
|
|
31
|
-
alias_method :behaviour, :example_group
|
32
|
-
|
33
38
|
def run(example_group_instance, reporter)
|
34
|
-
start
|
35
|
-
@in_block = false
|
36
39
|
@example_group_instance = example_group_instance
|
37
40
|
@example_group_instance.example = self
|
38
41
|
|
39
|
-
|
40
|
-
|
41
|
-
the_example = lambda do
|
42
|
-
begin
|
43
|
-
run_before_each
|
44
|
-
@in_block = true
|
45
|
-
@example_group_instance.instance_eval(&example_block) unless pending
|
46
|
-
rescue Exception => e
|
47
|
-
exception = e
|
48
|
-
ensure
|
49
|
-
@in_block = false
|
50
|
-
run_after_each
|
51
|
-
end
|
52
|
-
end
|
42
|
+
start
|
53
43
|
|
54
44
|
begin
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
unless pending
|
46
|
+
with_around_hooks do
|
47
|
+
begin
|
48
|
+
run_before_each
|
49
|
+
@in_block = true
|
50
|
+
with_pending_capture &@example_block
|
51
|
+
rescue Exception => e
|
52
|
+
@exception = e
|
53
|
+
ensure
|
54
|
+
@in_block = false
|
55
|
+
run_after_each
|
56
|
+
end
|
57
|
+
# FUCKME (DC): I really want to move the call below to the end of
|
58
|
+
# the with_around_hooks method, but it adds 4% to the run time.
|
59
|
+
# Why? (footnote - Dan North made me write this comment)
|
60
|
+
end.call
|
58
61
|
end
|
59
62
|
rescue Exception => e
|
60
|
-
exception
|
63
|
+
@exception ||= e
|
61
64
|
ensure
|
62
65
|
@example_group_instance.example = nil
|
63
66
|
assign_auto_description
|
64
67
|
end
|
65
68
|
|
66
|
-
|
67
|
-
run_failed(reporter, exception)
|
68
|
-
false
|
69
|
-
elsif pending_declared_in_example
|
70
|
-
run_pending(reporter, pending_declared_in_example)
|
71
|
-
true
|
72
|
-
elsif pending
|
73
|
-
run_pending(reporter, 'Not Yet Implemented')
|
74
|
-
true
|
75
|
-
else
|
76
|
-
run_passed(reporter)
|
77
|
-
true
|
78
|
-
end
|
69
|
+
finish(reporter)
|
79
70
|
end
|
80
71
|
|
81
72
|
private
|
82
73
|
|
83
|
-
def
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
def accum.run; call; end
|
88
|
-
lambda { example_group_instance.instance_exec(accum, &hook) }
|
74
|
+
def with_pending_capture
|
75
|
+
@pending_declared_in_example = catch(:pending_declared_in_example) do
|
76
|
+
@example_group_instance.instance_eval(&@example_block)
|
77
|
+
throw :pending_declared_in_example, false
|
89
78
|
end
|
90
79
|
end
|
91
80
|
|
92
|
-
def
|
93
|
-
|
81
|
+
def with_around_hooks(&wrapped_example)
|
82
|
+
around_hooks_for(@example_group_class).reverse.inject(wrapped_example) do |wrapper, hook|
|
83
|
+
def wrapper.run; call; end
|
84
|
+
lambda { @example_group_instance.instance_exec(wrapper, &hook) }
|
85
|
+
end
|
94
86
|
end
|
95
87
|
|
96
|
-
def
|
97
|
-
|
88
|
+
def around_hooks_for(example_group_class)
|
89
|
+
(RSpec.configuration.hooks[:around][:each] +
|
90
|
+
@example_group_class.ancestors.reverse.map{|a| a.hooks[:around][:each]}).flatten
|
98
91
|
end
|
99
92
|
|
100
|
-
def
|
101
|
-
|
93
|
+
def start
|
94
|
+
record :started_at => Time.now
|
102
95
|
end
|
103
96
|
|
104
|
-
def
|
105
|
-
|
97
|
+
def finish(reporter)
|
98
|
+
if @exception
|
99
|
+
record_finished 'failed', :exception_encountered => @exception
|
100
|
+
reporter.example_failed self
|
101
|
+
false
|
102
|
+
elsif @pending_declared_in_example
|
103
|
+
record_finished 'pending', :pending_message => @pending_declared_in_example
|
104
|
+
reporter.example_pending self
|
105
|
+
true
|
106
|
+
elsif pending
|
107
|
+
record_finished 'pending', :pending_message => 'Not Yet Implemented'
|
108
|
+
reporter.example_pending self
|
109
|
+
true
|
110
|
+
else
|
111
|
+
record_finished 'passed'
|
112
|
+
reporter.example_passed self
|
113
|
+
true
|
114
|
+
end
|
106
115
|
end
|
107
116
|
|
108
|
-
def
|
109
|
-
|
110
|
-
|
111
|
-
record_results :finished_at => finish_time, :run_time => (finish_time - execution_result[:started_at])
|
112
|
-
reporter.example_finished(self)
|
117
|
+
def record_finished(status, results={})
|
118
|
+
finished_at = Time.now
|
119
|
+
record results.merge(:status => status, :finished_at => finished_at, :run_time => (finished_at - execution_result[:started_at]))
|
113
120
|
end
|
114
121
|
|
115
122
|
def run_before_each
|
@@ -131,7 +138,7 @@ module RSpec
|
|
131
138
|
end
|
132
139
|
end
|
133
140
|
|
134
|
-
def
|
141
|
+
def record(results={})
|
135
142
|
execution_result.update(results)
|
136
143
|
end
|
137
144
|
|
@@ -18,10 +18,18 @@ module RSpec
|
|
18
18
|
@pending_examples ||= ::RSpec.world.find(examples, :execution_result => { :status => 'pending' })
|
19
19
|
end
|
20
20
|
|
21
|
+
def pending_count
|
22
|
+
pending_examples.size
|
23
|
+
end
|
24
|
+
|
21
25
|
def failed_examples
|
22
26
|
@failed_examples ||= ::RSpec.world.find(examples, :execution_result => { :status => 'failed' })
|
23
27
|
end
|
24
28
|
|
29
|
+
def failure_count
|
30
|
+
failed_examples.size
|
31
|
+
end
|
32
|
+
|
25
33
|
def report(count)
|
26
34
|
sync_output do
|
27
35
|
start(count)
|
@@ -50,14 +58,23 @@ module RSpec
|
|
50
58
|
@duration = Time.now - @start
|
51
59
|
end
|
52
60
|
|
53
|
-
def
|
61
|
+
def example_passed(example)
|
62
|
+
examples << example
|
63
|
+
end
|
64
|
+
|
65
|
+
def example_pending(example)
|
66
|
+
examples << example
|
67
|
+
end
|
68
|
+
|
69
|
+
def example_failed(example)
|
54
70
|
examples << example
|
55
71
|
end
|
56
72
|
|
57
73
|
# This method is invoked at the beginning of the execution of each example group.
|
58
74
|
# +example_group+ is the example_group.
|
59
75
|
#
|
60
|
-
# The next method to be invoked after this is
|
76
|
+
# The next method to be invoked after this is +example_passed+,
|
77
|
+
# +example_pending+, or +example_finished+
|
61
78
|
def add_example_group(example_group)
|
62
79
|
@example_group = example_group
|
63
80
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module RSpec
|
2
|
-
|
3
2
|
module Core
|
4
|
-
|
5
3
|
module Formatters
|
6
4
|
|
7
5
|
class BaseTextFormatter < BaseFormatter
|
@@ -18,7 +16,7 @@ module RSpec
|
|
18
16
|
output.puts "#{index.next}) #{failed_example}"
|
19
17
|
output.puts "#{padding}Failure/Error: #{read_failed_line(exception, failed_example).strip}"
|
20
18
|
exception.message.split("\n").each do |line|
|
21
|
-
output.puts "#{padding}#{
|
19
|
+
output.puts "#{padding}#{red(line)}"
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
@@ -27,31 +25,25 @@ module RSpec
|
|
27
25
|
end
|
28
26
|
|
29
27
|
output.puts
|
30
|
-
output.flush
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|
34
|
-
def
|
35
|
-
red(s)
|
36
|
-
end
|
37
|
-
|
38
|
-
def dump_summary
|
39
|
-
failure_count = failed_examples.size
|
40
|
-
pending_count = pending_examples.size
|
41
|
-
|
42
|
-
output.puts "\nFinished in #{format_seconds(duration)} seconds\n"
|
43
|
-
|
44
|
-
summary = summary_line(example_count, failure_count, pending_count)
|
45
|
-
|
31
|
+
def colorise_summary(summary)
|
46
32
|
if failure_count == 0
|
47
33
|
if pending_count > 0
|
48
|
-
|
34
|
+
yellow(summary)
|
49
35
|
else
|
50
|
-
|
36
|
+
green(summary)
|
51
37
|
end
|
52
38
|
else
|
53
|
-
|
39
|
+
red(summary)
|
54
40
|
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def dump_summary
|
44
|
+
output.puts "\nFinished in #{format_seconds(duration)} seconds\n"
|
45
|
+
|
46
|
+
output.puts colorise_summary(summary_line(example_count, failure_count, pending_count))
|
55
47
|
|
56
48
|
# Don't print out profiled info if there are failures, it just clutters the output
|
57
49
|
if profile_examples? && failure_count == 0
|
@@ -62,8 +54,6 @@ module RSpec
|
|
62
54
|
output.puts grey(" # #{format_caller(example.metadata[:location])}")
|
63
55
|
end
|
64
56
|
end
|
65
|
-
|
66
|
-
output.flush
|
67
57
|
end
|
68
58
|
|
69
59
|
def summary_line(example_count, failure_count, pending_count)
|
@@ -73,14 +63,6 @@ module RSpec
|
|
73
63
|
summary
|
74
64
|
end
|
75
65
|
|
76
|
-
def pluralize(count, string)
|
77
|
-
"#{count} #{string}#{'s' unless count == 1}"
|
78
|
-
end
|
79
|
-
|
80
|
-
def format_caller(caller_info)
|
81
|
-
caller_info.to_s.split(':in `block').first
|
82
|
-
end
|
83
|
-
|
84
66
|
def dump_pending
|
85
67
|
unless pending_examples.empty?
|
86
68
|
output.puts
|
@@ -90,20 +72,16 @@ module RSpec
|
|
90
72
|
output.puts grey(" # #{format_caller(pending_example.metadata[:location])}")
|
91
73
|
end
|
92
74
|
end
|
93
|
-
output.flush
|
94
75
|
end
|
95
76
|
|
96
77
|
def close
|
97
|
-
if IO === output && output != $stdout
|
98
|
-
output.close
|
99
|
-
end
|
78
|
+
output.close if IO === output && output != $stdout
|
100
79
|
end
|
101
80
|
|
102
|
-
|
81
|
+
protected
|
103
82
|
|
104
83
|
def color(text, color_code)
|
105
|
-
|
106
|
-
"#{color_code}#{text}\e[0m"
|
84
|
+
color_enabled? ? "#{color_code}#{text}\e[0m" : text
|
107
85
|
end
|
108
86
|
|
109
87
|
def bold(text)
|
@@ -138,10 +116,18 @@ module RSpec
|
|
138
116
|
color(text, "\e[90m")
|
139
117
|
end
|
140
118
|
|
119
|
+
private
|
120
|
+
|
121
|
+
def pluralize(count, string)
|
122
|
+
"#{count} #{string}#{'s' unless count == 1}"
|
123
|
+
end
|
124
|
+
|
125
|
+
def format_caller(caller_info)
|
126
|
+
caller_info.to_s.split(':in `block').first
|
127
|
+
end
|
128
|
+
|
141
129
|
end
|
142
130
|
|
143
131
|
end
|
144
|
-
|
145
132
|
end
|
146
|
-
|
147
133
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module RSpec
|
2
|
-
|
3
2
|
module Core
|
4
|
-
|
5
3
|
module Formatters
|
6
4
|
|
7
5
|
class DocumentationFormatter < BaseTextFormatter
|
@@ -24,23 +22,19 @@ module RSpec
|
|
24
22
|
@previous_nested_example_groups = example_group_chain
|
25
23
|
end
|
26
24
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
30
|
-
failure_output(example, example.execution_result[:exception_encountered])
|
31
|
-
when 'pending'
|
32
|
-
pending_output(example, example.execution_result[:pending_message])
|
33
|
-
when 'passed'
|
34
|
-
passed_output(example)
|
35
|
-
else
|
36
|
-
red(example.execution_result[:status])
|
37
|
-
end
|
25
|
+
def example_passed(example)
|
26
|
+
super
|
27
|
+
output.puts passed_output(example)
|
38
28
|
end
|
39
29
|
|
40
|
-
def
|
30
|
+
def example_pending(example)
|
41
31
|
super
|
42
|
-
output.puts
|
43
|
-
|
32
|
+
output.puts pending_output(example, example.execution_result[:pending_message])
|
33
|
+
end
|
34
|
+
|
35
|
+
def example_failed(example)
|
36
|
+
super
|
37
|
+
output.puts failure_output(example, example.execution_result[:exception_encountered])
|
44
38
|
end
|
45
39
|
|
46
40
|
def failure_output(example, exception)
|
@@ -71,7 +65,5 @@ module RSpec
|
|
71
65
|
end
|
72
66
|
|
73
67
|
end
|
74
|
-
|
75
68
|
end
|
76
|
-
|
77
69
|
end
|
@@ -1,36 +1,31 @@
|
|
1
1
|
module RSpec
|
2
|
-
|
3
2
|
module Core
|
4
|
-
|
5
3
|
module Formatters
|
6
4
|
|
7
5
|
class ProgressFormatter < BaseTextFormatter
|
8
6
|
|
9
|
-
def
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
def example_passed(example)
|
8
|
+
super
|
9
|
+
output.print green('.')
|
10
|
+
end
|
11
|
+
|
12
|
+
def example_pending(example)
|
13
|
+
super
|
14
|
+
output.print yellow('*')
|
17
15
|
end
|
18
16
|
|
19
|
-
def
|
17
|
+
def example_failed(example)
|
20
18
|
super
|
21
|
-
output.print
|
19
|
+
output.print red('F')
|
22
20
|
end
|
23
21
|
|
24
22
|
def start_dump(duration)
|
25
23
|
super
|
26
24
|
output.puts
|
27
|
-
output.flush
|
28
25
|
end
|
29
26
|
|
30
27
|
end
|
31
28
|
|
32
29
|
end
|
33
|
-
|
34
30
|
end
|
35
|
-
|
36
|
-
end
|
31
|
+
end
|
data/rspec-core.gemspec
CHANGED
@@ -5,14 +5,15 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-core}
|
8
|
-
s.version = "2.0.0.beta.
|
8
|
+
s.version = "2.0.0.beta.15"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Chad Humphries", "David Chelimsky"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-30}
|
13
|
+
s.default_executable = %q{rspec}
|
13
14
|
s.description = %q{RSpec runner and example groups}
|
14
15
|
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
15
|
-
s.executables = ["rspec"
|
16
|
+
s.executables = ["rspec"]
|
16
17
|
s.extra_rdoc_files = [
|
17
18
|
"README.markdown"
|
18
19
|
]
|
@@ -29,7 +30,6 @@ Gem::Specification.new do |s|
|
|
29
30
|
"VERSION",
|
30
31
|
"autotest/discover.rb",
|
31
32
|
"bin/rspec",
|
32
|
-
"bin/spec",
|
33
33
|
"cucumber.yml",
|
34
34
|
"features/command_line/example_name_option.feature",
|
35
35
|
"features/command_line/exit_status.feature",
|
@@ -101,6 +101,7 @@ Gem::Specification.new do |s|
|
|
101
101
|
"spec/rspec/core/command_line_spec.rb",
|
102
102
|
"spec/rspec/core/configuration_options_spec.rb",
|
103
103
|
"spec/rspec/core/configuration_spec.rb",
|
104
|
+
"spec/rspec/core/core_spec.rb",
|
104
105
|
"spec/rspec/core/deprecations_spec.rb",
|
105
106
|
"spec/rspec/core/drb_command_line_spec.rb",
|
106
107
|
"spec/rspec/core/example_group_spec.rb",
|
@@ -126,7 +127,6 @@ Gem::Specification.new do |s|
|
|
126
127
|
"spec/rspec/core/shared_example_group_spec.rb",
|
127
128
|
"spec/rspec/core/subject_spec.rb",
|
128
129
|
"spec/rspec/core/world_spec.rb",
|
129
|
-
"spec/rspec/core_spec.rb",
|
130
130
|
"spec/ruby_forker.rb",
|
131
131
|
"spec/spec_helper.rb",
|
132
132
|
"spec/support/matchers.rb",
|
@@ -135,21 +135,22 @@ Gem::Specification.new do |s|
|
|
135
135
|
s.homepage = %q{http://github.com/rspec/rspec-core}
|
136
136
|
s.post_install_message = %q{**************************************************
|
137
137
|
|
138
|
-
Thank you for installing rspec-core-2.0.0.beta.
|
138
|
+
Thank you for installing rspec-core-2.0.0.beta.15
|
139
139
|
|
140
140
|
**************************************************
|
141
141
|
}
|
142
142
|
s.rdoc_options = ["--charset=UTF-8"]
|
143
143
|
s.require_paths = ["lib"]
|
144
144
|
s.rubyforge_project = %q{rspec}
|
145
|
-
s.rubygems_version = %q{1.3.
|
146
|
-
s.summary = %q{rspec-core-2.0.0.beta.
|
145
|
+
s.rubygems_version = %q{1.3.7}
|
146
|
+
s.summary = %q{rspec-core-2.0.0.beta.15}
|
147
147
|
s.test_files = [
|
148
148
|
"spec/autotest/failed_results_re_spec.rb",
|
149
149
|
"spec/autotest/rspec_spec.rb",
|
150
150
|
"spec/rspec/core/command_line_spec.rb",
|
151
151
|
"spec/rspec/core/configuration_options_spec.rb",
|
152
152
|
"spec/rspec/core/configuration_spec.rb",
|
153
|
+
"spec/rspec/core/core_spec.rb",
|
153
154
|
"spec/rspec/core/deprecations_spec.rb",
|
154
155
|
"spec/rspec/core/drb_command_line_spec.rb",
|
155
156
|
"spec/rspec/core/example_group_spec.rb",
|
@@ -175,7 +176,6 @@ Gem::Specification.new do |s|
|
|
175
176
|
"spec/rspec/core/shared_example_group_spec.rb",
|
176
177
|
"spec/rspec/core/subject_spec.rb",
|
177
178
|
"spec/rspec/core/world_spec.rb",
|
178
|
-
"spec/rspec/core_spec.rb",
|
179
179
|
"spec/ruby_forker.rb",
|
180
180
|
"spec/spec_helper.rb",
|
181
181
|
"spec/support/matchers.rb"
|
@@ -185,20 +185,20 @@ Gem::Specification.new do |s|
|
|
185
185
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
186
186
|
s.specification_version = 3
|
187
187
|
|
188
|
-
if Gem::Version.new(Gem::
|
189
|
-
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
190
|
-
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
188
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
189
|
+
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.15"])
|
190
|
+
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.15"])
|
191
191
|
s.add_development_dependency(%q<cucumber>, [">= 0.5.3"])
|
192
192
|
s.add_development_dependency(%q<autotest>, [">= 4.2.9"])
|
193
193
|
else
|
194
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
195
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
194
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.15"])
|
195
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.15"])
|
196
196
|
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
197
197
|
s.add_dependency(%q<autotest>, [">= 4.2.9"])
|
198
198
|
end
|
199
199
|
else
|
200
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
201
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
200
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.15"])
|
201
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.15"])
|
202
202
|
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
203
203
|
s.add_dependency(%q<autotest>, [">= 4.2.9"])
|
204
204
|
end
|
@@ -40,7 +40,7 @@ module RSpec::Core
|
|
40
40
|
|
41
41
|
context "setting the files to run" do
|
42
42
|
|
43
|
-
it "
|
43
|
+
it "loads files not following pattern if named explicitly" do
|
44
44
|
file = "./spec/rspec/core/resources/a_bar.rb"
|
45
45
|
config.files_or_directories_to_run = file
|
46
46
|
config.files_to_run.should == [file]
|
@@ -48,12 +48,18 @@ module RSpec::Core
|
|
48
48
|
|
49
49
|
describe "with default --pattern" do
|
50
50
|
|
51
|
-
it "
|
51
|
+
it "loads files named _spec.rb" do
|
52
52
|
dir = "./spec/rspec/core/resources"
|
53
53
|
config.files_or_directories_to_run = dir
|
54
54
|
config.files_to_run.should == ["#{dir}/a_spec.rb"]
|
55
55
|
end
|
56
56
|
|
57
|
+
it "loads files in Windows" do
|
58
|
+
file = "C:\\path\\to\\project\\spec\\sub\\foo_spec.rb"
|
59
|
+
config.files_or_directories_to_run = file
|
60
|
+
config.files_to_run.should == [file]
|
61
|
+
end
|
62
|
+
|
57
63
|
end
|
58
64
|
|
59
65
|
describe "with explicit pattern (single)" do
|
@@ -4,10 +4,6 @@ describe RSpec::Core do
|
|
4
4
|
|
5
5
|
describe "#configuration" do
|
6
6
|
|
7
|
-
it "returns an instance of RSpec::Core::Configuration" do
|
8
|
-
RSpec.configuration.should be_an_instance_of(RSpec::Core::Configuration)
|
9
|
-
end
|
10
|
-
|
11
7
|
it "returns the same object every time" do
|
12
8
|
RSpec.configuration.should equal(RSpec.configuration)
|
13
9
|
end
|
@@ -16,21 +12,17 @@ describe RSpec::Core do
|
|
16
12
|
|
17
13
|
describe "#configure" do
|
18
14
|
|
19
|
-
it "
|
15
|
+
it "yields the current configuration" do
|
20
16
|
RSpec.configure do |config|
|
21
17
|
config.should == RSpec::configuration
|
22
18
|
end
|
23
19
|
end
|
24
20
|
|
25
|
-
it "should be callable without a block" do
|
26
|
-
lambda { RSpec.configure }.should_not raise_error
|
27
|
-
end
|
28
|
-
|
29
21
|
end
|
30
22
|
|
31
23
|
describe "#world" do
|
32
24
|
|
33
|
-
it "
|
25
|
+
it "returns the RSpec::Core::World instance the current run is using" do
|
34
26
|
RSpec.world.should be_instance_of(RSpec::Core::World)
|
35
27
|
end
|
36
28
|
|
@@ -9,25 +9,10 @@ describe RSpec::Core::Example, :parent_metadata => 'sample' do
|
|
9
9
|
example_group.example('example description')
|
10
10
|
end
|
11
11
|
|
12
|
-
describe "
|
13
|
-
it "
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
it "should have one for its description" do
|
18
|
-
example_instance.should respond_to(:description)
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should have one for its metadata" do
|
22
|
-
example_instance.should respond_to(:metadata)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should have one for its block" do
|
26
|
-
example_instance.should respond_to(:example_block)
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should have one for its options" do
|
30
|
-
example_instance.should respond_to(:options)
|
12
|
+
describe "#behaviour" do
|
13
|
+
it "is deprecated" do
|
14
|
+
RSpec.should_receive(:deprecate)
|
15
|
+
example_instance.behaviour
|
31
16
|
end
|
32
17
|
end
|
33
18
|
|
@@ -13,8 +13,16 @@ describe RSpec::Core::Formatters::BaseFormatter do
|
|
13
13
|
formatter.should have_interface_for(:add_example_group).with(1).argument
|
14
14
|
end
|
15
15
|
|
16
|
-
it "has
|
17
|
-
formatter.should have_interface_for(:
|
16
|
+
it "has example_passed as an interface with one argument" do
|
17
|
+
formatter.should have_interface_for(:example_passed).with(1).arguments
|
18
|
+
end
|
19
|
+
|
20
|
+
it "has example_pending as an interface with one argument" do
|
21
|
+
formatter.should have_interface_for(:example_pending).with(1).arguments
|
22
|
+
end
|
23
|
+
|
24
|
+
it "has example_failed as an interface with one argument" do
|
25
|
+
formatter.should have_interface_for(:example_failed).with(1).arguments
|
18
26
|
end
|
19
27
|
|
20
28
|
it "has start_dump as an interface with 1 arguments" do
|
@@ -20,7 +20,7 @@ module RSpec::Core::Formatters
|
|
20
20
|
|
21
21
|
formatter = RSpec::Core::Formatters::DocumentationFormatter.new(output)
|
22
22
|
|
23
|
-
examples.each {|e| formatter.
|
23
|
+
examples.each {|e| formatter.example_failed(e) }
|
24
24
|
|
25
25
|
output.string.should =~ /first example \(FAILED - 1\)/m
|
26
26
|
output.string.should =~ /second example \(FAILED - 2\)/m
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 62196477
|
4
5
|
prerelease: true
|
5
6
|
segments:
|
6
7
|
- 2
|
7
8
|
- 0
|
8
9
|
- 0
|
9
10
|
- beta
|
10
|
-
-
|
11
|
-
version: 2.0.0.beta.
|
11
|
+
- 15
|
12
|
+
version: 2.0.0.beta.15
|
12
13
|
platform: ruby
|
13
14
|
authors:
|
14
15
|
- Chad Humphries
|
@@ -17,74 +18,81 @@ autorequire:
|
|
17
18
|
bindir: bin
|
18
19
|
cert_chain: []
|
19
20
|
|
20
|
-
date: 2010-06-
|
21
|
-
default_executable:
|
21
|
+
date: 2010-06-30 00:00:00 -05:00
|
22
|
+
default_executable: rspec
|
22
23
|
dependencies:
|
23
24
|
- !ruby/object:Gem::Dependency
|
24
25
|
type: :development
|
26
|
+
prerelease: false
|
25
27
|
name: rspec-expectations
|
26
28
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
27
30
|
requirements:
|
28
31
|
- - ">="
|
29
32
|
- !ruby/object:Gem::Version
|
33
|
+
hash: 62196477
|
30
34
|
segments:
|
31
35
|
- 2
|
32
36
|
- 0
|
33
37
|
- 0
|
34
38
|
- beta
|
35
|
-
-
|
36
|
-
version: 2.0.0.beta.
|
39
|
+
- 15
|
40
|
+
version: 2.0.0.beta.15
|
37
41
|
requirement: *id001
|
38
|
-
prerelease: false
|
39
42
|
- !ruby/object:Gem::Dependency
|
40
43
|
type: :development
|
44
|
+
prerelease: false
|
41
45
|
name: rspec-mocks
|
42
46
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
43
48
|
requirements:
|
44
49
|
- - ">="
|
45
50
|
- !ruby/object:Gem::Version
|
51
|
+
hash: 62196477
|
46
52
|
segments:
|
47
53
|
- 2
|
48
54
|
- 0
|
49
55
|
- 0
|
50
56
|
- beta
|
51
|
-
-
|
52
|
-
version: 2.0.0.beta.
|
57
|
+
- 15
|
58
|
+
version: 2.0.0.beta.15
|
53
59
|
requirement: *id002
|
54
|
-
prerelease: false
|
55
60
|
- !ruby/object:Gem::Dependency
|
56
61
|
type: :development
|
62
|
+
prerelease: false
|
57
63
|
name: cucumber
|
58
64
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
59
66
|
requirements:
|
60
67
|
- - ">="
|
61
68
|
- !ruby/object:Gem::Version
|
69
|
+
hash: 13
|
62
70
|
segments:
|
63
71
|
- 0
|
64
72
|
- 5
|
65
73
|
- 3
|
66
74
|
version: 0.5.3
|
67
75
|
requirement: *id003
|
68
|
-
prerelease: false
|
69
76
|
- !ruby/object:Gem::Dependency
|
70
77
|
type: :development
|
78
|
+
prerelease: false
|
71
79
|
name: autotest
|
72
80
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
73
82
|
requirements:
|
74
83
|
- - ">="
|
75
84
|
- !ruby/object:Gem::Version
|
85
|
+
hash: 37
|
76
86
|
segments:
|
77
87
|
- 4
|
78
88
|
- 2
|
79
89
|
- 9
|
80
90
|
version: 4.2.9
|
81
91
|
requirement: *id004
|
82
|
-
prerelease: false
|
83
92
|
description: RSpec runner and example groups
|
84
93
|
email: dchelimsky@gmail.com;chad.humphries@gmail.com
|
85
94
|
executables:
|
86
95
|
- rspec
|
87
|
-
- spec
|
88
96
|
extensions: []
|
89
97
|
|
90
98
|
extra_rdoc_files:
|
@@ -102,7 +110,6 @@ files:
|
|
102
110
|
- VERSION
|
103
111
|
- autotest/discover.rb
|
104
112
|
- bin/rspec
|
105
|
-
- bin/spec
|
106
113
|
- cucumber.yml
|
107
114
|
- features/command_line/example_name_option.feature
|
108
115
|
- features/command_line/exit_status.feature
|
@@ -174,6 +181,7 @@ files:
|
|
174
181
|
- spec/rspec/core/command_line_spec.rb
|
175
182
|
- spec/rspec/core/configuration_options_spec.rb
|
176
183
|
- spec/rspec/core/configuration_spec.rb
|
184
|
+
- spec/rspec/core/core_spec.rb
|
177
185
|
- spec/rspec/core/deprecations_spec.rb
|
178
186
|
- spec/rspec/core/drb_command_line_spec.rb
|
179
187
|
- spec/rspec/core/example_group_spec.rb
|
@@ -199,7 +207,6 @@ files:
|
|
199
207
|
- spec/rspec/core/shared_example_group_spec.rb
|
200
208
|
- spec/rspec/core/subject_spec.rb
|
201
209
|
- spec/rspec/core/world_spec.rb
|
202
|
-
- spec/rspec/core_spec.rb
|
203
210
|
- spec/ruby_forker.rb
|
204
211
|
- spec/spec_helper.rb
|
205
212
|
- spec/support/matchers.rb
|
@@ -211,7 +218,7 @@ licenses: []
|
|
211
218
|
post_install_message: |
|
212
219
|
**************************************************
|
213
220
|
|
214
|
-
Thank you for installing rspec-core-2.0.0.beta.
|
221
|
+
Thank you for installing rspec-core-2.0.0.beta.15
|
215
222
|
|
216
223
|
**************************************************
|
217
224
|
|
@@ -220,16 +227,20 @@ rdoc_options:
|
|
220
227
|
require_paths:
|
221
228
|
- lib
|
222
229
|
required_ruby_version: !ruby/object:Gem::Requirement
|
230
|
+
none: false
|
223
231
|
requirements:
|
224
232
|
- - ">="
|
225
233
|
- !ruby/object:Gem::Version
|
234
|
+
hash: 3
|
226
235
|
segments:
|
227
236
|
- 0
|
228
237
|
version: "0"
|
229
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
|
+
none: false
|
230
240
|
requirements:
|
231
241
|
- - ">"
|
232
242
|
- !ruby/object:Gem::Version
|
243
|
+
hash: 25
|
233
244
|
segments:
|
234
245
|
- 1
|
235
246
|
- 3
|
@@ -238,16 +249,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
249
|
requirements: []
|
239
250
|
|
240
251
|
rubyforge_project: rspec
|
241
|
-
rubygems_version: 1.3.
|
252
|
+
rubygems_version: 1.3.7
|
242
253
|
signing_key:
|
243
254
|
specification_version: 3
|
244
|
-
summary: rspec-core-2.0.0.beta.
|
255
|
+
summary: rspec-core-2.0.0.beta.15
|
245
256
|
test_files:
|
246
257
|
- spec/autotest/failed_results_re_spec.rb
|
247
258
|
- spec/autotest/rspec_spec.rb
|
248
259
|
- spec/rspec/core/command_line_spec.rb
|
249
260
|
- spec/rspec/core/configuration_options_spec.rb
|
250
261
|
- spec/rspec/core/configuration_spec.rb
|
262
|
+
- spec/rspec/core/core_spec.rb
|
251
263
|
- spec/rspec/core/deprecations_spec.rb
|
252
264
|
- spec/rspec/core/drb_command_line_spec.rb
|
253
265
|
- spec/rspec/core/example_group_spec.rb
|
@@ -273,7 +285,6 @@ test_files:
|
|
273
285
|
- spec/rspec/core/shared_example_group_spec.rb
|
274
286
|
- spec/rspec/core/subject_spec.rb
|
275
287
|
- spec/rspec/core/world_spec.rb
|
276
|
-
- spec/rspec/core_spec.rb
|
277
288
|
- spec/ruby_forker.rb
|
278
289
|
- spec/spec_helper.rb
|
279
290
|
- spec/support/matchers.rb
|