rspec 0.6.2 → 0.6.3
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/CHANGES +10 -0
- data/EXAMPLES.rd +20 -19
- data/examples/stack.rb +4 -4
- data/examples/stack_spec.rb +61 -59
- data/lib/spec/api/helper/should_helper.rb +1 -0
- data/lib/spec/api/helper/should_negator.rb +1 -0
- data/lib/spec/api/mocks/message_expectation.rb +1 -1
- data/lib/spec/runner/backtrace_tweaker.rb +3 -2
- data/lib/spec/runner/reporter.rb +2 -0
- data/lib/spec/version.rb +1 -1
- metadata +3 -3
data/CHANGES
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
= RSpec Changelog
|
2
2
|
|
3
|
+
== Version 0.6.3
|
4
|
+
|
5
|
+
This release fixes some minor bugs related to RSpec on Rails
|
6
|
+
Note that if you upgrade a rails app with this version of the rspec_on_rails plugin
|
7
|
+
you should remove your lib/tasks/rspec.rake if it exists.
|
8
|
+
|
9
|
+
* Backtraces from drb (and other standard ruby libraries) are now stripped from backtraces.
|
10
|
+
* Applied [#5557] Put rspec.rake into the task directory of the RSpec on Rails plugin (Patch from Daniel Siemssen)
|
11
|
+
* Applied [#5556] rails_spec_runner loads environment.rb twice (Patch from Daniel Siemssen)
|
12
|
+
|
3
13
|
== Version 0.6.2
|
4
14
|
This release fixes a couple of regressions with the rake task that were introduced in the previous version (0.6.1)
|
5
15
|
|
data/EXAMPLES.rd
CHANGED
@@ -16,28 +16,29 @@
|
|
16
16
|
# * should raise an exception when the file length is less than 32 bytes
|
17
17
|
# A consumer of a mock
|
18
18
|
# * should be able to send messages to the mock
|
19
|
+
# A stack (in general)
|
20
|
+
# * should add to the top when sent 'push'
|
21
|
+
# * should return the top item when sent 'peek'
|
22
|
+
# * should NOT remove the top item when sent 'peek'
|
23
|
+
# * should return the top item when sent 'pop'
|
24
|
+
# * should remove the top item when sent 'pop'
|
19
25
|
# An empty stack
|
20
|
-
# * should
|
21
|
-
# * should
|
22
|
-
# * should complain when sent
|
23
|
-
#
|
24
|
-
#
|
25
|
-
# * should
|
26
|
-
# * should not
|
27
|
-
# * should
|
28
|
-
# * should remove top when sent pop
|
26
|
+
# * should be empty
|
27
|
+
# * should no longer be empty after 'push'
|
28
|
+
# * should complain when sent 'peek'
|
29
|
+
# * should complain when sent 'pop'
|
30
|
+
# An almost empty stack (with one item)
|
31
|
+
# * should not be empty
|
32
|
+
# * should remain not empty after 'peek'
|
33
|
+
# * should become empty after 'pop'
|
29
34
|
# An almost full stack (with one item less than capacity)
|
30
|
-
# * should
|
31
|
-
# * should
|
32
|
-
# * should not remove top when sent top
|
33
|
-
# * should return top when sent pop
|
34
|
-
# * should remove top when sent pop
|
35
|
+
# * should not be full
|
36
|
+
# * should become full when sent 'push'
|
35
37
|
# A full stack
|
36
|
-
# * should
|
37
|
-
# * should
|
38
|
-
# * should
|
39
|
-
# * should
|
40
|
-
# * should remove top when sent pop
|
38
|
+
# * should be full
|
39
|
+
# * should remain full after 'peek'
|
40
|
+
# * should no longer be full after 'pop'
|
41
|
+
# * should complain on 'push'
|
41
42
|
# Underscore sugar
|
42
43
|
# * should be available for regular objects
|
43
44
|
# * should be available for mocks
|
data/examples/stack.rb
CHANGED
@@ -20,7 +20,7 @@ class Stack
|
|
20
20
|
@items.delete @items.last
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
23
|
+
def peek
|
24
24
|
raise StackUnderflowError if @items.empty?
|
25
25
|
@items.last
|
26
26
|
end
|
@@ -28,9 +28,9 @@ class Stack
|
|
28
28
|
def empty?
|
29
29
|
@items.empty?
|
30
30
|
end
|
31
|
-
|
32
|
-
def
|
33
|
-
@items.length
|
31
|
+
|
32
|
+
def full?
|
33
|
+
@items.length == 10
|
34
34
|
end
|
35
35
|
|
36
36
|
end
|
data/examples/stack_spec.rb
CHANGED
@@ -1,115 +1,117 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../lib/spec'
|
2
2
|
require File.dirname(__FILE__) + "/stack"
|
3
3
|
|
4
|
-
context "
|
5
|
-
|
4
|
+
context "A stack (in general)" do
|
6
5
|
setup do
|
7
6
|
@stack = Stack.new
|
7
|
+
["a","b","c"].each { |x| @stack.push x }
|
8
8
|
end
|
9
9
|
|
10
|
-
specify "should
|
11
|
-
|
10
|
+
specify "should add to the top when sent 'push'" do
|
11
|
+
@stack.push "d"
|
12
|
+
@stack.peek.should_equal "d"
|
12
13
|
end
|
13
14
|
|
14
|
-
specify "should
|
15
|
-
|
15
|
+
specify "should return the top item when sent 'peek'" do
|
16
|
+
@stack.peek.should_equal "c"
|
16
17
|
end
|
17
18
|
|
18
|
-
specify "should
|
19
|
-
|
19
|
+
specify "should NOT remove the top item when sent 'peek'" do
|
20
|
+
@stack.peek.should_equal "c"
|
21
|
+
@stack.peek.should_equal "c"
|
22
|
+
end
|
23
|
+
|
24
|
+
specify "should return the top item when sent 'pop'" do
|
25
|
+
@stack.pop.should_equal "c"
|
20
26
|
end
|
21
27
|
|
28
|
+
specify "should remove the top item when sent 'pop'" do
|
29
|
+
@stack.pop.should_equal "c"
|
30
|
+
@stack.pop.should_equal "b"
|
31
|
+
end
|
22
32
|
end
|
23
33
|
|
24
|
-
context "
|
25
|
-
|
34
|
+
context "An empty stack" do
|
26
35
|
setup do
|
27
36
|
@stack = Stack.new
|
28
|
-
@stack.push 3
|
29
|
-
end
|
30
|
-
|
31
|
-
specify "should accept an item when sent push" do
|
32
|
-
lambda { @stack.push Object.new }.should_not_raise
|
33
37
|
end
|
34
38
|
|
35
|
-
specify "should
|
36
|
-
@stack.
|
39
|
+
specify "should be empty" do
|
40
|
+
@stack.should_be_empty
|
37
41
|
end
|
38
42
|
|
39
|
-
specify "should
|
40
|
-
@stack.
|
41
|
-
@stack.
|
43
|
+
specify "should no longer be empty after 'push'" do
|
44
|
+
@stack.push "anything"
|
45
|
+
@stack.should_not_be_empty
|
42
46
|
end
|
43
47
|
|
44
|
-
specify "should
|
45
|
-
@stack.
|
48
|
+
specify "should complain when sent 'peek'" do
|
49
|
+
lambda { @stack.peek }.should_raise StackUnderflowError
|
46
50
|
end
|
47
51
|
|
48
|
-
specify "should
|
49
|
-
@stack.pop.should_be 3
|
52
|
+
specify "should complain when sent 'pop'" do
|
50
53
|
lambda { @stack.pop }.should_raise StackUnderflowError
|
51
54
|
end
|
52
|
-
|
53
55
|
end
|
54
56
|
|
55
|
-
context "An almost
|
56
|
-
|
57
|
+
context "An almost empty stack (with one item)" do
|
57
58
|
setup do
|
58
59
|
@stack = Stack.new
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
specify "should accept an item when sent push" do
|
63
|
-
@stack.push Object.new
|
60
|
+
@stack.push 3
|
64
61
|
end
|
65
62
|
|
66
|
-
specify "should
|
67
|
-
@stack.
|
63
|
+
specify "should not be empty" do
|
64
|
+
@stack.should_not_be_empty
|
68
65
|
end
|
69
66
|
|
70
|
-
specify "should not
|
71
|
-
@stack.
|
72
|
-
@stack.
|
67
|
+
specify "should remain not empty after 'peek'" do
|
68
|
+
@stack.peek
|
69
|
+
@stack.should_not_be_empty
|
73
70
|
end
|
74
71
|
|
75
|
-
specify "should
|
76
|
-
@stack.pop
|
72
|
+
specify "should become empty after 'pop'" do
|
73
|
+
@stack.pop
|
74
|
+
@stack.should_be_empty
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context "An almost full stack (with one item less than capacity)" do
|
79
|
+
setup do
|
80
|
+
@stack = Stack.new
|
81
|
+
(1..9).each { |i| @stack.push i }
|
77
82
|
end
|
78
83
|
|
79
|
-
specify "should
|
80
|
-
@stack.
|
81
|
-
@stack.pop.should_be 8
|
84
|
+
specify "should not be full" do
|
85
|
+
@stack.should_not_be_full
|
82
86
|
end
|
83
87
|
|
88
|
+
specify "should become full when sent 'push'" do
|
89
|
+
@stack.push Object.new
|
90
|
+
@stack.should_be_full
|
91
|
+
end
|
84
92
|
end
|
85
93
|
|
86
94
|
context "A full stack" do
|
87
|
-
|
88
95
|
setup do
|
89
96
|
@stack = Stack.new
|
90
97
|
(1..10).each { |i| @stack.push i }
|
91
98
|
end
|
92
|
-
|
93
|
-
specify "should complain on push" do
|
94
|
-
lambda { @stack.push Object.new }.should_raise StackOverflowError
|
95
|
-
end
|
96
99
|
|
97
|
-
specify "should
|
98
|
-
@stack.
|
100
|
+
specify "should be full" do
|
101
|
+
@stack.should_be_full
|
99
102
|
end
|
100
103
|
|
101
|
-
specify "should
|
102
|
-
@stack.
|
103
|
-
@stack.
|
104
|
+
specify "should remain full after 'peek'" do
|
105
|
+
@stack.peek
|
106
|
+
@stack.should_be_full
|
104
107
|
end
|
105
108
|
|
106
|
-
specify "should
|
107
|
-
@stack.pop
|
109
|
+
specify "should no longer be full after 'pop'" do
|
110
|
+
@stack.pop
|
111
|
+
@stack.should_not_be_full
|
108
112
|
end
|
109
|
-
|
110
|
-
specify "should
|
111
|
-
@stack.
|
112
|
-
@stack.pop.should_be 9
|
113
|
+
|
114
|
+
specify "should complain on 'push'" do
|
115
|
+
lambda { @stack.push Object.new }.should_raise StackOverflowError
|
113
116
|
end
|
114
|
-
|
115
117
|
end
|
@@ -62,7 +62,7 @@ module Spec
|
|
62
62
|
|
63
63
|
def handle_order_constraint
|
64
64
|
return unless @ordered
|
65
|
-
return @ordering.consume(
|
65
|
+
return @ordering.consume(self) if @ordering.ready_for?(self)
|
66
66
|
message = "Mock '#{@mock_name}' received '#{@sym}' out of order"
|
67
67
|
Kernel::raise(Spec::Api::MockExpectationError, message)
|
68
68
|
end
|
@@ -24,13 +24,14 @@ module Spec
|
|
24
24
|
return if error.backtrace.nil?
|
25
25
|
error.backtrace.collect! do |line|
|
26
26
|
line = tweak_instance_exec_line line, spec_name
|
27
|
+
line = nil if line =~ /\/lib\/ruby\//
|
27
28
|
line = nil if line =~ /\/lib\/spec\/api\//
|
28
29
|
line = nil if line =~ /\/lib\/spec\/runner\//
|
29
30
|
line = nil if line =~ /bin\/spec:/
|
31
|
+
line = nil if line =~ /lib\/rspec_on_rails/
|
32
|
+
line = nil if line =~ /script\/rails_spec/
|
30
33
|
# TextMate's Ruby plugin
|
31
34
|
line = nil if line =~ /Ruby\.tmbundle\/Support\/tmruby.rb:/
|
32
|
-
# RSpec on Rails
|
33
|
-
line = nil if line =~ /gems\/rspec_generator/
|
34
35
|
line
|
35
36
|
end
|
36
37
|
error.backtrace.compact!
|
data/lib/spec/runner/reporter.rb
CHANGED
data/lib/spec/version.rb
CHANGED
metadata
CHANGED
@@ -3,9 +3,9 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rspec
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.6.
|
7
|
-
date: 2006-08-
|
8
|
-
summary: RSpec-0.6.
|
6
|
+
version: 0.6.3
|
7
|
+
date: 2006-08-29 00:00:00 +02:00
|
8
|
+
summary: RSpec-0.6.3 - BDD for Ruby http://rspec.rubyforge.org/
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: rspec-devel@rubyforge.org
|