rspec 1.3.0 → 1.3.1.rc
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +17 -0
- data/README.rdoc +10 -23
- data/examples/passing/shared_example_group_example.rb +0 -36
- data/examples/passing/simple_matcher_example.rb +3 -3
- data/features/interop/test_but_not_test_unit.feature +1 -1
- data/features/interop/test_case_with_should_methods.feature +1 -1
- data/geminstaller.yml +3 -2
- data/lib/spec/deprecation.rb +2 -1
- data/lib/spec/dsl/main.rb +1 -0
- data/lib/spec/example/example_group_methods.rb +6 -1
- data/lib/spec/example/subject.rb +8 -2
- data/lib/spec/matchers.rb +1 -1
- data/lib/spec/matchers/operator_matcher.rb +6 -1
- data/lib/spec/matchers/pretty.rb +2 -2
- data/lib/spec/matchers/simple_matcher.rb +2 -1
- data/lib/spec/matchers/throw_symbol.rb +2 -2
- data/lib/spec/mocks/proxy.rb +2 -0
- data/lib/spec/runner/backtrace_tweaker.rb +3 -2
- data/lib/spec/runner/configuration.rb +8 -0
- data/lib/spec/runner/options.rb +2 -1
- data/lib/spec/version.rb +2 -2
- data/spec/spec/dsl/main_spec.rb +10 -2
- data/spec/spec/example/example_group_methods_spec.rb +19 -0
- data/spec/spec/example/example_matcher_spec.rb +3 -4
- data/spec/spec/example/subject_spec.rb +7 -0
- data/spec/spec/expectations/wrap_expectation_spec.rb +2 -1
- data/spec/spec/matchers/have_spec.rb +278 -293
- data/spec/spec/matchers/match_array_spec.rb +5 -0
- data/spec/spec/matchers/simple_matcher_spec.rb +51 -44
- data/spec/spec/matchers/throw_symbol_spec.rb +3 -3
- data/spec/spec/mocks/bug_report_496_spec.rb +2 -4
- data/spec/spec_helper.rb +1 -1
- metadata +99 -34
@@ -97,6 +97,11 @@ the missing elements were: [1]
|
|
97
97
|
MESSAGE
|
98
98
|
end
|
99
99
|
|
100
|
+
it "should work with subclasses of Array" do
|
101
|
+
class SuperArray < Array; end
|
102
|
+
SuperArray.new([1,2,3]).should =~ SuperArray.new([3,2,1])
|
103
|
+
end
|
104
|
+
|
100
105
|
end
|
101
106
|
|
102
107
|
describe "should_not =~ [:with, :multiple, :args]" do
|
@@ -3,6 +3,13 @@ require 'spec_helper'
|
|
3
3
|
module Spec
|
4
4
|
module Matchers
|
5
5
|
describe SimpleMatcher do
|
6
|
+
before { Spec.stub(:deprecate) }
|
7
|
+
|
8
|
+
it "is deprecated" do
|
9
|
+
Spec.should_receive(:deprecate)
|
10
|
+
simple_matcher("foo") {}
|
11
|
+
end
|
12
|
+
|
6
13
|
it "should pass match arg to block" do
|
7
14
|
actual = nil
|
8
15
|
matcher = simple_matcher("message") do |given| actual = given end
|
@@ -35,59 +42,59 @@ module Spec
|
|
35
42
|
matcher.matches?("anything").should be_true
|
36
43
|
end.should fail_with(/expected: 3/)
|
37
44
|
end
|
38
|
-
end
|
39
45
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
46
|
+
describe "with arity of 2" do
|
47
|
+
it "should provide the matcher so you can access its messages" do
|
48
|
+
provided_matcher = nil
|
49
|
+
matcher = simple_matcher("thing") do |given, matcher|
|
50
|
+
provided_matcher = matcher
|
51
|
+
end
|
52
|
+
matcher.matches?("anything")
|
53
|
+
provided_matcher.should equal(matcher)
|
45
54
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
matcher.failure_message
|
55
|
+
|
56
|
+
it "should support a custom failure message" do
|
57
|
+
matcher = simple_matcher("thing") do |given, matcher|
|
58
|
+
matcher.failure_message = "custom message"
|
59
|
+
end
|
60
|
+
matcher.matches?("other")
|
61
|
+
matcher.failure_message.should == "custom message"
|
53
62
|
end
|
54
|
-
matcher.matches?("other")
|
55
|
-
matcher.failure_message.should == "custom message"
|
56
|
-
end
|
57
63
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
64
|
+
it "should complain when asked for a failure message if you don't give it a description or a message" do
|
65
|
+
matcher = simple_matcher do |given, matcher| end
|
66
|
+
matcher.matches?("other")
|
67
|
+
matcher.failure_message.should =~ /No description provided/
|
68
|
+
end
|
63
69
|
|
64
|
-
|
65
|
-
|
66
|
-
|
70
|
+
it "should support a custom negative failure message" do
|
71
|
+
matcher = simple_matcher("thing") do |given, matcher|
|
72
|
+
matcher.negative_failure_message = "custom message"
|
73
|
+
end
|
74
|
+
matcher.matches?("other")
|
75
|
+
matcher.negative_failure_message.should == "custom message"
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should complain when asked for a negative failure message if you don't give it a description or a message" do
|
79
|
+
matcher = simple_matcher do |given, matcher| end
|
80
|
+
matcher.matches?("other")
|
81
|
+
matcher.negative_failure_message.should =~ /No description provided/
|
67
82
|
end
|
68
|
-
matcher.matches?("other")
|
69
|
-
matcher.negative_failure_message.should == "custom message"
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should complain when asked for a negative failure message if you don't give it a description or a message" do
|
73
|
-
matcher = simple_matcher do |given, matcher| end
|
74
|
-
matcher.matches?("other")
|
75
|
-
matcher.negative_failure_message.should =~ /No description provided/
|
76
|
-
end
|
77
83
|
|
78
|
-
|
79
|
-
|
80
|
-
|
84
|
+
it "should support a custom description" do
|
85
|
+
matcher = simple_matcher("thing") do |given, matcher|
|
86
|
+
matcher.description = "custom message"
|
87
|
+
end
|
88
|
+
matcher.matches?("description")
|
89
|
+
matcher.description.should == "custom message"
|
81
90
|
end
|
82
|
-
matcher.matches?("description")
|
83
|
-
matcher.description.should == "custom message"
|
84
|
-
end
|
85
91
|
|
86
|
-
|
87
|
-
|
88
|
-
|
92
|
+
it "should tell you no description was provided when it doesn't receive one" do
|
93
|
+
matcher = simple_matcher do end
|
94
|
+
matcher.description.should =~ /No description provided/
|
95
|
+
end
|
89
96
|
end
|
97
|
+
|
90
98
|
end
|
91
|
-
|
92
99
|
end
|
93
|
-
end
|
100
|
+
end
|
@@ -4,7 +4,7 @@ module Spec
|
|
4
4
|
module Matchers
|
5
5
|
describe ThrowSymbol do
|
6
6
|
describe "with no args" do
|
7
|
-
let(:matcher) {
|
7
|
+
let(:matcher) { throw_symbol }
|
8
8
|
|
9
9
|
it "matches if any Symbol is thrown" do
|
10
10
|
matcher.matches?(lambda{ throw :sym }).should be_true
|
@@ -30,7 +30,7 @@ module Spec
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "with a symbol" do
|
33
|
-
let(:matcher) {
|
33
|
+
let(:matcher) { throw_symbol(:sym) }
|
34
34
|
|
35
35
|
it "matches if correct Symbol is thrown" do
|
36
36
|
matcher.matches?(lambda{ throw :sym }).should be_true
|
@@ -75,7 +75,7 @@ module Spec
|
|
75
75
|
end
|
76
76
|
|
77
77
|
describe "with a symbol and an arg" do
|
78
|
-
let(:matcher) {
|
78
|
+
let(:matcher) { throw_symbol(:sym, "a") }
|
79
79
|
|
80
80
|
it "matches if correct Symbol and args are thrown" do
|
81
81
|
matcher.matches?(lambda{ throw :sym, "a" }).should be_true
|
@@ -9,10 +9,8 @@ module BugReport496
|
|
9
9
|
|
10
10
|
describe "a message expectation on a base class object" do
|
11
11
|
it "should correctly pick up message sent to it subclass" do
|
12
|
-
|
13
|
-
|
14
|
-
SubClass.new
|
15
|
-
end
|
12
|
+
BaseClass.should_receive(:new).once
|
13
|
+
SubClass.new
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 7712022
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
- 1
|
10
|
+
- rc
|
11
|
+
version: 1.3.1.rc
|
5
12
|
platform: ruby
|
6
13
|
authors:
|
7
14
|
- RSpec Development Team
|
@@ -9,69 +16,119 @@ autorequire:
|
|
9
16
|
bindir: bin
|
10
17
|
cert_chain: []
|
11
18
|
|
12
|
-
date: 2010-
|
19
|
+
date: 2010-10-03 00:00:00 -05:00
|
13
20
|
default_executable:
|
14
21
|
dependencies:
|
15
22
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
23
|
+
name: rubyforge
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 7
|
31
|
+
segments:
|
32
|
+
- 2
|
33
|
+
- 0
|
34
|
+
- 4
|
35
|
+
version: 2.0.4
|
17
36
|
type: :development
|
18
|
-
|
19
|
-
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: cucumber
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
20
43
|
requirements:
|
21
44
|
- - ">="
|
22
45
|
- !ruby/object:Gem::Version
|
46
|
+
hash: 13
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
- 3
|
23
50
|
version: "0.3"
|
24
|
-
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
25
53
|
- !ruby/object:Gem::Dependency
|
26
54
|
name: fakefs
|
27
|
-
|
28
|
-
|
29
|
-
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
30
58
|
requirements:
|
31
59
|
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 21
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
- 2
|
65
|
+
- 1
|
33
66
|
version: 0.2.1
|
34
|
-
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
35
69
|
- !ruby/object:Gem::Dependency
|
36
70
|
name: syntax
|
37
|
-
|
38
|
-
|
39
|
-
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
40
74
|
requirements:
|
41
75
|
- - ">="
|
42
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 15
|
78
|
+
segments:
|
79
|
+
- 1
|
80
|
+
- 0
|
43
81
|
version: "1.0"
|
44
|
-
|
82
|
+
type: :development
|
83
|
+
version_requirements: *id004
|
45
84
|
- !ruby/object:Gem::Dependency
|
46
85
|
name: diff-lcs
|
47
|
-
|
48
|
-
|
49
|
-
|
86
|
+
prerelease: false
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
50
89
|
requirements:
|
51
90
|
- - ">="
|
52
91
|
- !ruby/object:Gem::Version
|
92
|
+
hash: 23
|
93
|
+
segments:
|
94
|
+
- 1
|
95
|
+
- 1
|
96
|
+
- 2
|
53
97
|
version: 1.1.2
|
54
|
-
|
98
|
+
type: :development
|
99
|
+
version_requirements: *id005
|
55
100
|
- !ruby/object:Gem::Dependency
|
56
101
|
name: heckle
|
57
|
-
|
58
|
-
|
59
|
-
|
102
|
+
prerelease: false
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
60
105
|
requirements:
|
61
106
|
- - ">="
|
62
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 1
|
109
|
+
segments:
|
110
|
+
- 1
|
111
|
+
- 4
|
112
|
+
- 3
|
63
113
|
version: 1.4.3
|
64
|
-
|
114
|
+
type: :development
|
115
|
+
version_requirements: *id006
|
65
116
|
- !ruby/object:Gem::Dependency
|
66
117
|
name: hoe
|
67
|
-
|
68
|
-
|
69
|
-
|
118
|
+
prerelease: false
|
119
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
70
121
|
requirements:
|
71
122
|
- - ">="
|
72
123
|
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
|
124
|
+
hash: 19
|
125
|
+
segments:
|
126
|
+
- 2
|
127
|
+
- 6
|
128
|
+
- 2
|
129
|
+
version: 2.6.2
|
130
|
+
type: :development
|
131
|
+
version_requirements: *id007
|
75
132
|
description: Behaviour Driven Development for Ruby.
|
76
133
|
email:
|
77
134
|
- rspec-devel@rubyforge.org
|
@@ -477,7 +534,7 @@ licenses: []
|
|
477
534
|
post_install_message: |
|
478
535
|
**************************************************
|
479
536
|
|
480
|
-
Thank you for installing rspec-1.3.
|
537
|
+
Thank you for installing rspec-1.3.1.rc
|
481
538
|
|
482
539
|
Please be sure to read History.rdoc and Upgrade.rdoc
|
483
540
|
for useful information about this release.
|
@@ -490,23 +547,31 @@ rdoc_options:
|
|
490
547
|
require_paths:
|
491
548
|
- lib
|
492
549
|
required_ruby_version: !ruby/object:Gem::Requirement
|
550
|
+
none: false
|
493
551
|
requirements:
|
494
552
|
- - ">="
|
495
553
|
- !ruby/object:Gem::Version
|
554
|
+
hash: 3
|
555
|
+
segments:
|
556
|
+
- 0
|
496
557
|
version: "0"
|
497
|
-
version:
|
498
558
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
559
|
+
none: false
|
499
560
|
requirements:
|
500
|
-
- - "
|
561
|
+
- - ">"
|
501
562
|
- !ruby/object:Gem::Version
|
502
|
-
|
503
|
-
|
563
|
+
hash: 25
|
564
|
+
segments:
|
565
|
+
- 1
|
566
|
+
- 3
|
567
|
+
- 1
|
568
|
+
version: 1.3.1
|
504
569
|
requirements: []
|
505
570
|
|
506
571
|
rubyforge_project: rspec
|
507
|
-
rubygems_version: 1.3.
|
572
|
+
rubygems_version: 1.3.7
|
508
573
|
signing_key:
|
509
574
|
specification_version: 3
|
510
|
-
summary: rspec 1.3.
|
575
|
+
summary: rspec 1.3.1.rc
|
511
576
|
test_files: []
|
512
577
|
|