rspec 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +22 -1
- data/Rakefile +8 -12
- data/bin/drbspec +3 -0
- data/bin/spec +3 -3
- data/lib/spec/expectations/extensions/inspect_for_expectation_not_met_error.rb +2 -1
- data/lib/spec/expectations/extensions/object.rb +115 -0
- data/lib/spec/expectations/should.rb +1 -0
- data/lib/spec/expectations/should/base.rb +1 -0
- data/lib/spec/expectations/should/change.rb +64 -0
- data/lib/spec/expectations/should/have.rb +14 -16
- data/lib/spec/expectations/should/not.rb +6 -2
- data/lib/spec/expectations/should/should.rb +6 -3
- data/lib/spec/rake/spectask.rb +6 -1
- data/lib/spec/runner.rb +1 -0
- data/lib/spec/runner/backtrace_tweaker.rb +1 -0
- data/lib/spec/runner/context_eval.rb +4 -2
- data/lib/spec/runner/drb_command_line.rb +21 -0
- data/lib/spec/runner/execution_context.rb +1 -0
- data/lib/spec/runner/specification.rb +2 -4
- data/lib/spec/version.rb +3 -3
- data/vendor/watir/find_rspecs_home_page.txt +1 -1
- metadata +6 -3
data/CHANGES
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
= RSpec Changelog
|
2
2
|
|
3
|
-
== Version 0.7.
|
3
|
+
== Version 0.7.3 (In SVN)
|
4
|
+
|
5
|
+
Almost normal bug fix/new feature release.
|
6
|
+
|
7
|
+
A couple of things you need to change in your rails specs:
|
8
|
+
# spec_helper.rb is a little different (see http://rspec.rubyforge.org/upgrade.html)
|
9
|
+
# use controller.should_render before OR after the action (controller.should_have_rendered is deprecated)
|
10
|
+
|
11
|
+
* Applied [#6577] messy mock backtrace when frozen to edge rails (patch from Jay Levitt)
|
12
|
+
* Fixed [#6674] rspec_on_rails fails on @session deprecation warning
|
13
|
+
* Fixed [#6780] routing() was failing...fix included - works for 1.1.6 and edge (1.2)
|
14
|
+
* Fixed [#6835] bad message with arbitrary predicate
|
15
|
+
* Added [#6731] Partial templates rendered
|
16
|
+
* Fixed [#6713] helper methods not rendered in view tests?
|
17
|
+
* Fixed [#6707] cannot run controller / helper tests via rails_spec or spec only works with rake
|
18
|
+
* Applied [#6417] lambda {...}.should_change(receiver, :message) (patch from Wilson Bilkovich)
|
19
|
+
* Eliminated dependency on ZenTest
|
20
|
+
* Fixed [#6650] Reserved characters in the TextMate bundle break svn on Win32
|
21
|
+
* Fixed [#6643] script/generate rspec_controller: invalid symbol generation for 'controller_name' for *modularized* controllers
|
22
|
+
* The script/rails_spec command has been moved to bin/drbspec in RSpec core (installed by the gem)
|
23
|
+
|
24
|
+
== Version 0.7.2
|
4
25
|
|
5
26
|
This release introduces a brand new RSpec bundle for TextMate, plus some small bugfixes.
|
6
27
|
|
data/Rakefile
CHANGED
@@ -36,7 +36,7 @@ Spec::Rake::SpecTask.new do |t|
|
|
36
36
|
t.spec_opts = ['--diff','--color','--backtrace']
|
37
37
|
t.rcov = true
|
38
38
|
t.rcov_dir = 'doc/output/coverage'
|
39
|
-
t.rcov_opts = ['--exclude', 'spec\/spec,bin\/spec,examples']
|
39
|
+
t.rcov_opts = ['--exclude', 'spec\/spec,bin\/spec,bin\/drbspec,examples']
|
40
40
|
end
|
41
41
|
|
42
42
|
desc "Run all failing examples"
|
@@ -48,7 +48,7 @@ desc 'Verify that no warnings occur'
|
|
48
48
|
task :verify_warnings do
|
49
49
|
`ruby -w #{File.dirname(__FILE__) + '/bin/spec'} --help 2> warnings.txt`
|
50
50
|
warnings = File.open('warnings.txt').read
|
51
|
-
File.rm 'warnings.txt'
|
51
|
+
File.rm 'warnings.txt' rescue nil
|
52
52
|
raise "There were warnings:\n#{warnings}" if warnings =~ /warning/n
|
53
53
|
end
|
54
54
|
|
@@ -92,9 +92,9 @@ spec = Gem::Specification.new do |s|
|
|
92
92
|
s.test_files = Dir.glob('test/*_test.rb')
|
93
93
|
s.require_path = 'lib'
|
94
94
|
s.autorequire = 'spec'
|
95
|
-
s.bindir =
|
96
|
-
s.executables = [
|
97
|
-
s.default_executable =
|
95
|
+
s.bindir = 'bin'
|
96
|
+
s.executables = ['spec', 'drbspec']
|
97
|
+
s.default_executable = 'spec'
|
98
98
|
s.author = ["Steven Baker", "Aslak Hellesoy", "Dave Astels", "David Chelimsky", "Brian Takita"]
|
99
99
|
s.email = "rspec-devel@rubyforge.org"
|
100
100
|
s.homepage = "http://rspec.rubyforge.org"
|
@@ -159,7 +159,7 @@ task :touch_revision_storing_files do
|
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
162
|
-
task :release => [:clobber, :verify_committed, :verify_user, :
|
162
|
+
task :release => [:clobber, :verify_committed, :verify_user, :spec, :publish_packages, :tag, :publish_website, :publish_news]
|
163
163
|
|
164
164
|
desc "Verifies that there is no uncommitted code"
|
165
165
|
task :verify_committed do
|
@@ -209,10 +209,6 @@ task :verify_user do
|
|
209
209
|
raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
|
210
210
|
end
|
211
211
|
|
212
|
-
task :verify_password do
|
213
|
-
raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
|
214
|
-
end
|
215
|
-
|
216
212
|
desc "Upload Website to RubyForge"
|
217
213
|
task :publish_website => [:verify_user, :website] do
|
218
214
|
publisher = Rake::SshDirPublisher.new(
|
@@ -235,7 +231,7 @@ end
|
|
235
231
|
task :package => :package_tmbundle
|
236
232
|
|
237
233
|
desc "Publish gem+tgz+zip on RubyForge. You must make sure lib/version.rb is aligned with the CHANGELOG file"
|
238
|
-
task :publish_packages => [:verify_user, :
|
234
|
+
task :publish_packages => [:verify_user, :package] do
|
239
235
|
require 'meta_project'
|
240
236
|
require 'rake/contrib/xforge'
|
241
237
|
release_files = FileList[
|
@@ -255,7 +251,7 @@ task :publish_packages => [:verify_user, :verify_password, :package] do
|
|
255
251
|
end
|
256
252
|
|
257
253
|
desc "Publish news on RubyForge"
|
258
|
-
task :publish_news => [:verify_user
|
254
|
+
task :publish_news => [:verify_user] do
|
259
255
|
require 'meta_project'
|
260
256
|
require 'rake/contrib/xforge'
|
261
257
|
Rake::XForge::NewsPublisher.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |news|
|
data/bin/drbspec
ADDED
data/bin/spec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
|
2
|
+
# require File.expand_path(File.dirname(__FILE__) + "/../lib/spec")
|
3
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
4
|
+
require 'spec'
|
4
5
|
::Spec::Runner::CommandLine.run(ARGV, STDERR, STDOUT, true, true)
|
5
|
-
|
@@ -11,4 +11,5 @@ class Class; def inspect_for_expectation_not_met_error; "<#{name}>" end end
|
|
11
11
|
class Proc; def inspect_for_expectation_not_met_error; "<Proc>" end end
|
12
12
|
class Array; def inspect_for_expectation_not_met_error; inspect end end
|
13
13
|
class String; def inspect_for_expectation_not_met_error; inspect end end
|
14
|
-
class Numeric; def inspect_for_expectation_not_met_error; inspect end end
|
14
|
+
class Numeric; def inspect_for_expectation_not_met_error; inspect end end
|
15
|
+
class Hash; def inspect_for_expectation_not_met_error; inspect end end
|
@@ -4,6 +4,121 @@ module Spec
|
|
4
4
|
def should
|
5
5
|
Should::Should.new self
|
6
6
|
end
|
7
|
+
|
8
|
+
def should_not
|
9
|
+
should.not
|
10
|
+
end
|
11
|
+
|
12
|
+
def should_equal(arg)
|
13
|
+
should.equal(arg)
|
14
|
+
end
|
15
|
+
|
16
|
+
def should_not_equal(arg)
|
17
|
+
should.not.equal(arg)
|
18
|
+
end
|
19
|
+
|
20
|
+
def should_eql(arg)
|
21
|
+
should.eql(arg)
|
22
|
+
end
|
23
|
+
|
24
|
+
def should_not_eql(arg)
|
25
|
+
should.not.eql(arg)
|
26
|
+
end
|
27
|
+
|
28
|
+
def should_have(arg)
|
29
|
+
should.have(arg)
|
30
|
+
end
|
31
|
+
alias_method :should_have_exactly, :should_have
|
32
|
+
|
33
|
+
def should_have_at_least(arg)
|
34
|
+
should.have.at_least(arg)
|
35
|
+
end
|
36
|
+
|
37
|
+
def should_have_at_most(arg)
|
38
|
+
should.have.at_most(arg)
|
39
|
+
end
|
40
|
+
|
41
|
+
def should_include(arg)
|
42
|
+
should.include(arg)
|
43
|
+
end
|
44
|
+
|
45
|
+
def should_not_include(arg)
|
46
|
+
should.not.include(arg)
|
47
|
+
end
|
48
|
+
|
49
|
+
def should_change(receiver, message)
|
50
|
+
should.change(receiver, message)
|
51
|
+
end
|
52
|
+
|
53
|
+
def should_not_change(receiver, message)
|
54
|
+
should.not.change(receiver, message)
|
55
|
+
end
|
56
|
+
|
57
|
+
def should_be(expected = :___no_arg)
|
58
|
+
should.be(expected)
|
59
|
+
end
|
60
|
+
|
61
|
+
def should_not_be(expected = :___no_arg)
|
62
|
+
should.not.be(expected)
|
63
|
+
end
|
64
|
+
|
65
|
+
def should_satisfy(&block)
|
66
|
+
should.satisfy(&block)
|
67
|
+
end
|
68
|
+
|
69
|
+
def should_not_satisfy(&block)
|
70
|
+
should.not.satisfy(&block)
|
71
|
+
end
|
72
|
+
|
73
|
+
def should_be_an_instance_of(expected_class)
|
74
|
+
should.be.an_instance_of(expected_class)
|
75
|
+
end
|
76
|
+
alias_method :should_be_instance_of, :should_be_an_instance_of
|
77
|
+
|
78
|
+
def should_not_be_an_instance_of(expected_class)
|
79
|
+
should.not.be.an_instance_of(expected_class)
|
80
|
+
end
|
81
|
+
|
82
|
+
def should_be_a_kind_of(expected_class)
|
83
|
+
should.be.a_kind_of(expected_class)
|
84
|
+
end
|
85
|
+
alias_method :should_be_kind_of, :should_be_a_kind_of
|
86
|
+
|
87
|
+
def should_not_be_a_kind_of(expected_class)
|
88
|
+
should.not.be.a_kind_of(expected_class)
|
89
|
+
end
|
90
|
+
|
91
|
+
def should_respond_to(message)
|
92
|
+
should.respond_to(message)
|
93
|
+
end
|
94
|
+
|
95
|
+
def should_not_respond_to(message)
|
96
|
+
should.not.respond_to(message)
|
97
|
+
end
|
98
|
+
|
99
|
+
def should_match(expression)
|
100
|
+
should.match(expression)
|
101
|
+
end
|
102
|
+
|
103
|
+
def should_not_match(expression)
|
104
|
+
should.not.match(expression)
|
105
|
+
end
|
106
|
+
|
107
|
+
def should_raise(exception=Exception, message=nil)
|
108
|
+
should.raise(exception, message)
|
109
|
+
end
|
110
|
+
|
111
|
+
def should_not_raise(exception=Exception, message=nil)
|
112
|
+
should.not.raise(exception, message)
|
113
|
+
end
|
114
|
+
|
115
|
+
def should_throw(symbol)
|
116
|
+
should.throw(symbol)
|
117
|
+
end
|
118
|
+
|
119
|
+
def should_not_throw(symbol=:___this_is_a_symbol_that_will_likely_never_occur___)
|
120
|
+
should.not.throw(symbol)
|
121
|
+
end
|
7
122
|
end
|
8
123
|
end
|
9
124
|
end
|
@@ -29,6 +29,7 @@ module Spec
|
|
29
29
|
return Not.new(@target).__send__(original_sym.to_s[4..-1].to_sym, *args, &block)
|
30
30
|
end
|
31
31
|
if original_sym.to_s =~ /^be_/
|
32
|
+
@be_seen = true
|
32
33
|
return __send__(original_sym.to_s[3..-1].to_sym, *args, &block)
|
33
34
|
end
|
34
35
|
if original_sym.to_s =~ /^have_/
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Spec
|
2
|
+
module Expectations
|
3
|
+
module Should
|
4
|
+
class Change < Base
|
5
|
+
|
6
|
+
def initialize(target, receiver, message)
|
7
|
+
@target = target
|
8
|
+
@receiver = receiver
|
9
|
+
@message = message
|
10
|
+
execute_change
|
11
|
+
evaluate_change
|
12
|
+
end
|
13
|
+
|
14
|
+
def execute_change
|
15
|
+
@before_change = @receiver.send(@message)
|
16
|
+
@target.call
|
17
|
+
@after_change = @receiver.send(@message)
|
18
|
+
end
|
19
|
+
|
20
|
+
def evaluate_change
|
21
|
+
if @before_change == @after_change
|
22
|
+
fail_with_message "#{@message} should have changed, but is still #{@after_change.inspect}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def from(value)
|
27
|
+
if @before_change != value
|
28
|
+
fail_with_message "#{@message} should have initially been #{value.inspect}, but was #{@before_change.inspect}"
|
29
|
+
end
|
30
|
+
self
|
31
|
+
end
|
32
|
+
|
33
|
+
def to(value)
|
34
|
+
if @after_change != value
|
35
|
+
fail_with_message "#{@message} should have been changed to #{value.inspect}, but is now #{@after_change.inspect}"
|
36
|
+
end
|
37
|
+
self
|
38
|
+
end
|
39
|
+
|
40
|
+
def by(expected_delta)
|
41
|
+
if actual_delta != expected_delta
|
42
|
+
fail_with_message "#{@message} should have been changed by #{expected_delta}, but was changed by #{actual_delta}"
|
43
|
+
end
|
44
|
+
self
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def actual_delta
|
49
|
+
@after_change - @before_change
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class NotChange < Change
|
54
|
+
def evaluate_change
|
55
|
+
if @before_change != @after_change
|
56
|
+
fail_with_message "#{@message} should not have changed, but is now #{@after_change.inspect}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
@@ -3,21 +3,13 @@ module Spec
|
|
3
3
|
module Should
|
4
4
|
class Have < Base
|
5
5
|
|
6
|
-
def initialize(target, relativity=:exactly, expected=nil
|
6
|
+
def initialize(target, relativity=:exactly, expected=nil)
|
7
7
|
@target = target
|
8
8
|
@expected = expected == :no ? 0 : expected
|
9
9
|
@at_least = (relativity == :at_least)
|
10
10
|
@at_most = (relativity == :at_most)
|
11
|
-
@negate = negate
|
12
11
|
end
|
13
12
|
|
14
|
-
def exactly(expected_number=nil)
|
15
|
-
@at_least = false
|
16
|
-
@at_most = false
|
17
|
-
@expected = expected_number == :no ? 0 : expected_number
|
18
|
-
self
|
19
|
-
end
|
20
|
-
|
21
13
|
def at_least(expected_number=nil)
|
22
14
|
@at_least = true
|
23
15
|
@at_most = false
|
@@ -36,17 +28,16 @@ module Spec
|
|
36
28
|
if @target.respond_to?(sym)
|
37
29
|
fail_with_message(build_message(sym, args)) unless as_specified?(sym, args)
|
38
30
|
elsif @target.respond_to?("has_#{sym}?")
|
39
|
-
|
40
|
-
return unless @target.send("has_#{sym}?", *args)
|
41
|
-
fail_with_message msg(sym, args, "should not have")
|
42
|
-
else
|
43
|
-
return if @target.send("has_#{sym}?", *args)
|
44
|
-
fail_with_message msg(sym, args, "should have")
|
45
|
-
end
|
31
|
+
check_has_sym(sym, *args)
|
46
32
|
else
|
47
33
|
raise NoMethodError.new("#{@target.inspect} does not respond to `#{sym}' or `has_#{sym}?'")
|
48
34
|
end
|
49
35
|
end
|
36
|
+
|
37
|
+
def check_has_sym(sym, *args)
|
38
|
+
return if @target.send("has_#{sym}?", *args)
|
39
|
+
fail_with_message msg(sym, args, "should have")
|
40
|
+
end
|
50
41
|
|
51
42
|
def msg(sym, args, text)
|
52
43
|
"#{@target.inspect_for_expectation_not_met_error} #{text} #{sym}: #{args.collect{|arg| arg.inspect_for_expectation_not_met_error}.join(', ')}"
|
@@ -74,6 +65,13 @@ module Spec
|
|
74
65
|
@target.send(sym, *args)
|
75
66
|
end
|
76
67
|
end
|
68
|
+
|
69
|
+
class NotHave < Have
|
70
|
+
def check_has_sym(sym, *args)
|
71
|
+
return unless @target.send("has_#{sym}?", *args)
|
72
|
+
fail_with_message msg(sym, args, "should not have")
|
73
|
+
end
|
74
|
+
end
|
77
75
|
end
|
78
76
|
end
|
79
77
|
end
|
@@ -9,7 +9,11 @@ module Spec
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def have(expected_number=nil)
|
12
|
-
|
12
|
+
NotHave.new(@target, :exactly, expected_number)
|
13
|
+
end
|
14
|
+
|
15
|
+
def change(receiver, message)
|
16
|
+
NotChange.new(@target, receiver, message)
|
13
17
|
end
|
14
18
|
|
15
19
|
def satisfy
|
@@ -64,7 +68,7 @@ module Spec
|
|
64
68
|
|
65
69
|
def __delegate_method_missing_to_target original_sym, actual_sym, *args
|
66
70
|
return unless @target.__send__(actual_sym, *args)
|
67
|
-
fail_with_message(default_message("should not#{@be_seen ? ' be' : ''} #{original_sym}" + (args.empty? ? '' :
|
71
|
+
fail_with_message(default_message("should not#{@be_seen ? ' be' : ''} #{original_sym}" + (args.empty? ? '' : ' ' + args[0].inspect)))
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
@@ -12,6 +12,10 @@ module Spec
|
|
12
12
|
Have.new(@target, :exactly, expected_number)
|
13
13
|
end
|
14
14
|
|
15
|
+
def change(receiver, message)
|
16
|
+
Change.new(@target, receiver, message)
|
17
|
+
end
|
18
|
+
|
15
19
|
def not
|
16
20
|
Not.new(@target)
|
17
21
|
end
|
@@ -41,8 +45,7 @@ module Spec
|
|
41
45
|
|
42
46
|
def __delegate_method_missing_to_target(original_sym, actual_sym, *args)
|
43
47
|
return if @target.send(actual_sym, *args)
|
44
|
-
|
45
|
-
fail_with_message(message)
|
48
|
+
fail_with_message(default_message("should#{@be_seen ? ' be' : ''} #{original_sym}" + (args.empty? ? '' : ' ' + args[0].inspect)))
|
46
49
|
end
|
47
50
|
|
48
51
|
def match(expected)
|
@@ -80,4 +83,4 @@ module Spec
|
|
80
83
|
end
|
81
84
|
end
|
82
85
|
end
|
83
|
-
end
|
86
|
+
end
|
data/lib/spec/rake/spectask.rb
CHANGED
@@ -63,6 +63,11 @@ module Spec
|
|
63
63
|
|
64
64
|
# A message to print to stdout when there are failures.
|
65
65
|
attr_accessor :failure_message
|
66
|
+
|
67
|
+
# Whether or not to run specs via DRb. Setting this to true may
|
68
|
+
# run specs faster, especially in a Rails environment.
|
69
|
+
# Defaults to false
|
70
|
+
attr_accessor :drb
|
66
71
|
|
67
72
|
# Explicitly define the list of spec files to be included in a
|
68
73
|
# spec. +list+ is expected to be an array of file names (a
|
@@ -93,7 +98,7 @@ module Spec
|
|
93
98
|
end
|
94
99
|
|
95
100
|
def define
|
96
|
-
spec_script = File.expand_path(File.dirname(__FILE__) + '/../../../bin/spec')
|
101
|
+
spec_script = File.expand_path(File.dirname(__FILE__) + '/../../../bin/' + (drb ? 'drbspec' : 'spec'))
|
97
102
|
|
98
103
|
lib_path = @libs.join(File::PATH_SEPARATOR)
|
99
104
|
actual_name = Hash === name ? name.keys.first : name
|
data/lib/spec/runner.rb
CHANGED
@@ -6,6 +6,7 @@ require 'spec/runner/execution_context'
|
|
6
6
|
require 'spec/runner/context_runner'
|
7
7
|
require 'spec/runner/option_parser'
|
8
8
|
require 'spec/runner/command_line'
|
9
|
+
require 'spec/runner/drb_command_line'
|
9
10
|
require 'spec/runner/backtrace_tweaker'
|
10
11
|
require 'spec/runner/reporter'
|
11
12
|
require 'spec/runner/spec_matcher'
|
@@ -32,6 +32,7 @@ module Spec
|
|
32
32
|
line = nil if line =~ /bin\/spec:/
|
33
33
|
line = nil if line =~ /bin\/rcov:/
|
34
34
|
line = nil if line =~ /lib\/rspec_on_rails/
|
35
|
+
line = nil if line =~ /vendor\/rails/
|
35
36
|
line = nil if line =~ /script\/rails_spec/
|
36
37
|
# TextMate's Ruby and RSpec plugins
|
37
38
|
line = nil if line =~ /Ruby\.tmbundle\/Support\/tmruby.rb:/
|
@@ -28,7 +28,8 @@ module Spec
|
|
28
28
|
my_methods |= context_superclass.methods
|
29
29
|
my_methods
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
|
+
protected
|
32
33
|
|
33
34
|
def method_missing(method_name, *args)
|
34
35
|
if context_superclass.respond_to?(method_name)
|
@@ -37,7 +38,8 @@ module Spec
|
|
37
38
|
super
|
38
39
|
end
|
39
40
|
|
40
|
-
|
41
|
+
private
|
42
|
+
|
41
43
|
def setup_block
|
42
44
|
parts = setup_parts.dup
|
43
45
|
add_context_superclass_method(:setup, parts)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "drb/drb"
|
2
|
+
|
3
|
+
module Spec
|
4
|
+
module Runner
|
5
|
+
# Facade to run specs by connecting to a DRB server
|
6
|
+
class DrbCommandLine
|
7
|
+
# Runs specs on a DRB server. Note that this API is similar to that of
|
8
|
+
# CommandLine - making it possible for clients to use both interchangeably.
|
9
|
+
def self.run(argv, stderr, stdout, exit=false, warn_if_no_files=true)
|
10
|
+
begin
|
11
|
+
DRb.start_service
|
12
|
+
rails_spec_server = DRbObject.new_with_uri("druby://localhost:8989")
|
13
|
+
rails_spec_server.run(argv, stderr, stdout)
|
14
|
+
rescue DRb::DRbConnError
|
15
|
+
stderr.puts "No server is running"
|
16
|
+
exit 1 if exit
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -16,11 +16,10 @@ module Spec
|
|
16
16
|
@listeners = []
|
17
17
|
end
|
18
18
|
|
19
|
-
def run(reporter
|
19
|
+
def run(reporter, setup_block, teardown_block, dry_run, execution_context)
|
20
20
|
reporter.spec_started(@name) unless reporter.nil?
|
21
21
|
return reporter.spec_finished(@name) if dry_run
|
22
22
|
@@current_spec = self
|
23
|
-
execution_context = execution_context || ::Spec::Runner::ExecutionContext.new(self)
|
24
23
|
errors = []
|
25
24
|
begin
|
26
25
|
execution_context.instance_exec(&setup_block) unless setup_block.nil?
|
@@ -40,9 +39,8 @@ module Spec
|
|
40
39
|
notify_after_teardown errors
|
41
40
|
@@current_spec = nil
|
42
41
|
end
|
43
|
-
|
44
|
-
SpecShouldRaiseHandler.new(@from, @options).handle(errors)
|
45
42
|
|
43
|
+
SpecShouldRaiseHandler.new(@from, @options).handle(errors)
|
46
44
|
reporter.spec_finished(@name, errors.first, failure_location(setup_ok, spec_ok, teardown_ok)) unless reporter.nil?
|
47
45
|
end
|
48
46
|
|
data/lib/spec/version.rb
CHANGED
@@ -3,9 +3,9 @@ module Spec
|
|
3
3
|
unless defined? MAJOR
|
4
4
|
MAJOR = 0
|
5
5
|
MINOR = 7
|
6
|
-
TINY =
|
7
|
-
# RANDOM_TOKEN: 0.
|
8
|
-
REV = "$LastChangedRevision:
|
6
|
+
TINY = 3
|
7
|
+
# RANDOM_TOKEN: 0.690694587701409
|
8
|
+
REV = "$LastChangedRevision: 1137 $".match(/LastChangedRevision: (\d+)/)[1]
|
9
9
|
|
10
10
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
11
11
|
FULL_VERSION = "#{STRING} (r#{REV})"
|
metadata
CHANGED
@@ -3,9 +3,9 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rspec
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.7.
|
7
|
-
date: 2006-11-
|
8
|
-
summary: RSpec-0.7.
|
6
|
+
version: 0.7.3
|
7
|
+
date: 2006-11-25 00:00:00 +00:00
|
8
|
+
summary: RSpec-0.7.3 (r1137) - BDD for Ruby http://rspec.rubyforge.org/
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: rspec-devel@rubyforge.org
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- lib/spec/expectations/extensions/object.rb
|
55
55
|
- lib/spec/expectations/extensions/symbol.rb
|
56
56
|
- lib/spec/expectations/should/base.rb
|
57
|
+
- lib/spec/expectations/should/change.rb
|
57
58
|
- lib/spec/expectations/should/have.rb
|
58
59
|
- lib/spec/expectations/should/not.rb
|
59
60
|
- lib/spec/expectations/should/should.rb
|
@@ -73,6 +74,7 @@ files:
|
|
73
74
|
- lib/spec/runner/context.rb
|
74
75
|
- lib/spec/runner/context_eval.rb
|
75
76
|
- lib/spec/runner/context_runner.rb
|
77
|
+
- lib/spec/runner/drb_command_line.rb
|
76
78
|
- lib/spec/runner/execution_context.rb
|
77
79
|
- lib/spec/runner/formatter.rb
|
78
80
|
- lib/spec/runner/option_parser.rb
|
@@ -123,6 +125,7 @@ extra_rdoc_files:
|
|
123
125
|
- CHANGES
|
124
126
|
executables:
|
125
127
|
- spec
|
128
|
+
- drbspec
|
126
129
|
extensions: []
|
127
130
|
|
128
131
|
requirements: []
|