rspec-expectations 2.0.0.beta.2 → 2.0.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,4 +5,4 @@ rdoc
5
5
  pkg
6
6
  doc
7
7
  tmp
8
- *.gemspec
8
+ rerun.txt
data/Rakefile CHANGED
@@ -33,6 +33,13 @@ rescue LoadError
33
33
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
34
34
  end
35
35
 
36
+ namespace :gem do
37
+ desc "push to gemcutter"
38
+ task :push => :build do
39
+ system "gem push pkg/rspec-expectations-#{Rspec::Expectations::Version::STRING}.gem"
40
+ end
41
+ end
42
+
36
43
  begin
37
44
  require 'rspec/core/rake_task'
38
45
  Rspec::Core::RakeTask.new(:spec)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.beta.2
1
+ 2.0.0.beta.3
@@ -0,0 +1,7 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "#{rerun_opts} --require features --format rerun --out rerun.txt --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %>
7
+ wip: --tags @wip:3 --wip features
@@ -7,8 +7,6 @@ Feature: customized message
7
7
  Scenario: one additional method
8
8
  Given a file named "node_spec.rb" with:
9
9
  """
10
- require "rspec/expectations"
11
-
12
10
  class Node
13
11
  def initialize(state=:waiting)
14
12
  @state = state
@@ -0,0 +1,52 @@
1
+ Feature: implicit docstrings
2
+
3
+ As an RSpec user
4
+ I want examples to generate their own names
5
+ So that I can reduce duplication between example names and example code
6
+
7
+ Scenario: run passing examples
8
+ Given a file named "implicit_docstrings_spec.rb" with:
9
+ """
10
+ describe "Examples with no docstrings generate their own:" do
11
+
12
+ specify { 3.should be < 5 }
13
+
14
+ specify { [1,2,3].should include(2) }
15
+
16
+ specify { [1,2,3].should respond_to(:size) }
17
+
18
+ end
19
+ """
20
+
21
+ When I run "rspec implicit_docstrings_spec.rb -fdoc"
22
+
23
+ Then I should see "should be < 5"
24
+ And I should see "should include 2"
25
+ And I should see "should respond to #size"
26
+
27
+ Scenario Outline: run failing examples
28
+ Given a file named "failing_implicit_docstrings_spec.rb" with:
29
+ """
30
+ describe "Failing examples with no descriptions" do
31
+
32
+ # description is auto-generated as "should equal(5)" based on the last #should
33
+ it do
34
+ 3.should equal(2)
35
+ 5.should equal(5)
36
+ end
37
+
38
+ it { 3.should be > 5 }
39
+
40
+ it { [1,2,3].should include(4) }
41
+
42
+ it { [1,2,3].should_not respond_to(:size) }
43
+
44
+ end
45
+ """
46
+
47
+ When I run "rspec failing_implicit_docstrings_spec.rb -fdoc"
48
+
49
+ Then I should see "should equal 2"
50
+ And I should see "should be > 5"
51
+ And I should see "should include "b""
52
+ And I should see "should not respond to #size"
@@ -0,0 +1,27 @@
1
+ Feature: define diffable matcher
2
+
3
+ When a matcher is defined as diffable, and the --diff
4
+ flag is set, the output will include a diff of the submitted
5
+ objects.
6
+
7
+ @wip
8
+ Scenario: define a diffable matcher
9
+ Given a file named "diffable_matcher_spec.rb" with:
10
+ """
11
+ Rspec::Matchers.define :be_just_like do |expected|
12
+ match do |actual|
13
+ actual == expected
14
+ end
15
+
16
+ diffable
17
+ end
18
+
19
+ describe "this" do
20
+ it {should be_just_like("that")}
21
+ end
22
+ """
23
+ When I run "rspec diffable_matcher_spec.rb --diff"
24
+ Then the exit status should not be 0
25
+
26
+ And I should see "should be just like that"
27
+ And I should see "Diff:\n@@ -1,2 +1,2 @@\n-that\n+this"
@@ -0,0 +1,27 @@
1
+ Feature: define matcher
2
+
3
+ In order to express my domain clearly in my code examples
4
+ As an RSpec user
5
+ I want to define matchers with fluent interfaces
6
+
7
+ Scenario: one additional method
8
+ Given a file named "between_spec.rb" with:
9
+ """
10
+ Rspec::Matchers.define :be_bigger_than do |first|
11
+ def but_smaller_than(second)
12
+ @second = second
13
+ self
14
+ end
15
+
16
+ match do |actual|
17
+ (actual > first) && (actual < @second)
18
+ end
19
+ end
20
+
21
+ describe 5 do
22
+ it { should be_bigger_than(4).but_smaller_than(6) }
23
+ end
24
+ """
25
+ When I run "rspec between_spec.rb --format specdoc"
26
+ Then I should see "1 example, 0 failures"
27
+ And I should see "should be bigger than 4"
@@ -0,0 +1,65 @@
1
+ Feature: expect change
2
+
3
+ Expect some code (wrapped in a proc) to change the state of some object.
4
+
5
+ Scenario: expecting change
6
+ Given a file named "expect_change_spec.rb" with:
7
+ """
8
+ class Counter
9
+ class << self
10
+ def increment
11
+ @count ||= 0
12
+ @count += 1
13
+ end
14
+
15
+ def count
16
+ @count ||= 0
17
+ end
18
+ end
19
+ end
20
+
21
+ describe Counter, "#increment" do
22
+ it "should increment the count" do
23
+ expect{Counter.increment}.to change{Counter.count}.from(0).to(1)
24
+ end
25
+
26
+ # deliberate failure
27
+ it "should increment the count by 2" do
28
+ expect{Counter.increment}.to change{Counter.count}.by(2)
29
+ end
30
+ end
31
+ """
32
+ When I run "spec expect_change_spec.rb"
33
+ Then I should see "2 examples, 1 failure"
34
+ Then I should see "should have been changed by 2, but was changed by 1"
35
+
36
+ Scenario: expecting no change
37
+ Given a file named "expect_no_change_spec.rb" with:
38
+ """
39
+ class Counter
40
+ class << self
41
+ def increment
42
+ @count ||= 0
43
+ @count += 1
44
+ end
45
+
46
+ def count
47
+ @count ||= 0
48
+ end
49
+ end
50
+ end
51
+
52
+ describe Counter, "#increment" do
53
+ it "should not increment the count by 2" do
54
+ expect{Counter.increment}.to_not change{Counter.count}.from(0).to(2)
55
+ end
56
+
57
+ # deliberate failure
58
+ it "should not increment the count by 1" do
59
+ expect{Counter.increment}.to_not change{Counter.count}.by(1)
60
+ end
61
+ end
62
+ """
63
+ When I run "spec expect_no_change_spec.rb"
64
+ Then I should see "2 examples, 1 failure"
65
+ Then I should see "should not have changed, but did change from 1 to 2"
@@ -0,0 +1,44 @@
1
+ Feature: expect error
2
+
3
+ Expect a proc to change the state of some object.
4
+
5
+ Scenario: expect error
6
+ Given a file named "expect_error_spec.rb" with:
7
+ """
8
+ describe Object, "#non_existent_message" do
9
+ it "should raise" do
10
+ expect{Object.non_existent_message}.to raise_error(NameError)
11
+ end
12
+ end
13
+
14
+ #deliberate failure
15
+ describe Object, "#public_instance_methods" do
16
+ it "should raise" do
17
+ expect{Object.public_instance_methods}.to raise_error(NameError)
18
+ end
19
+ end
20
+ """
21
+ When I run "spec expect_error_spec.rb"
22
+ Then I should see "2 examples, 1 failure"
23
+ Then I should see "expected NameError but nothing was raised"
24
+
25
+ Scenario: expect no error
26
+ Given a file named "expect_no_error_spec.rb" with:
27
+ """
28
+ describe Object, "#public_instance_methods" do
29
+ it "should not raise" do
30
+ expect{Object.public_instance_methods}.to_not raise_error(NameError)
31
+ end
32
+ end
33
+
34
+ #deliberate failure
35
+ describe Object, "#non_existent_message" do
36
+ it "should not raise" do
37
+ expect{Object.non_existent_message}.to_not raise_error(NameError)
38
+ end
39
+ end
40
+ """
41
+ When I run "spec expect_no_error_spec.rb"
42
+ Then I should see "2 examples, 1 failure"
43
+ Then I should see "undefined method `non_existent_message'"
44
+
@@ -0,0 +1,179 @@
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-expectations}
8
+ s.version = "2.0.0.beta.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["David Chelimsky", "Chad Humphries"]
12
+ s.date = %q{2010-03-08}
13
+ s.description = %q{rspec expectations (should[_not] and matchers)}
14
+ s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.markdown"
17
+ ]
18
+ s.files = [
19
+ ".document",
20
+ ".gitignore",
21
+ "License.txt",
22
+ "README.markdown",
23
+ "Rakefile",
24
+ "Upgrade.markdown",
25
+ "VERSION",
26
+ "cucumber.yml",
27
+ "features/expectations/customized_message.feature",
28
+ "features/expectations/implicit_docstrings.feature",
29
+ "features/matchers/define_diffable_matcher.feature",
30
+ "features/matchers/define_matcher.feature",
31
+ "features/matchers/define_matcher_outside_rspec.feature",
32
+ "features/matchers/define_matcher_with_fluent_interface.feature",
33
+ "features/matchers/expect_change.feature",
34
+ "features/matchers/expect_error.feature",
35
+ "features/support/env.rb",
36
+ "lib/rspec/expectations.rb",
37
+ "lib/rspec/expectations/differs/default.rb",
38
+ "lib/rspec/expectations/differs/load-diff-lcs.rb",
39
+ "lib/rspec/expectations/errors.rb",
40
+ "lib/rspec/expectations/extensions.rb",
41
+ "lib/rspec/expectations/extensions/kernel.rb",
42
+ "lib/rspec/expectations/extensions/rspec/core/example_group.rb",
43
+ "lib/rspec/expectations/fail_with.rb",
44
+ "lib/rspec/expectations/handler.rb",
45
+ "lib/rspec/expectations/version.rb",
46
+ "lib/rspec/matchers.rb",
47
+ "lib/rspec/matchers/be.rb",
48
+ "lib/rspec/matchers/be_close.rb",
49
+ "lib/rspec/matchers/be_instance_of.rb",
50
+ "lib/rspec/matchers/be_kind_of.rb",
51
+ "lib/rspec/matchers/change.rb",
52
+ "lib/rspec/matchers/compatibility.rb",
53
+ "lib/rspec/matchers/dsl.rb",
54
+ "lib/rspec/matchers/eq.rb",
55
+ "lib/rspec/matchers/eql.rb",
56
+ "lib/rspec/matchers/equal.rb",
57
+ "lib/rspec/matchers/errors.rb",
58
+ "lib/rspec/matchers/exist.rb",
59
+ "lib/rspec/matchers/extensions/instance_exec.rb",
60
+ "lib/rspec/matchers/generated_descriptions.rb",
61
+ "lib/rspec/matchers/has.rb",
62
+ "lib/rspec/matchers/have.rb",
63
+ "lib/rspec/matchers/include.rb",
64
+ "lib/rspec/matchers/match.rb",
65
+ "lib/rspec/matchers/match_array.rb",
66
+ "lib/rspec/matchers/matcher.rb",
67
+ "lib/rspec/matchers/method_missing.rb",
68
+ "lib/rspec/matchers/operator_matcher.rb",
69
+ "lib/rspec/matchers/pretty.rb",
70
+ "lib/rspec/matchers/raise_error.rb",
71
+ "lib/rspec/matchers/respond_to.rb",
72
+ "lib/rspec/matchers/satisfy.rb",
73
+ "lib/rspec/matchers/throw_symbol.rb",
74
+ "rspec-expectations.gemspec",
75
+ "spec/rspec/expectations/differs/default_spec.rb",
76
+ "spec/rspec/expectations/extensions/kernel_spec.rb",
77
+ "spec/rspec/expectations/fail_with_spec.rb",
78
+ "spec/rspec/expectations/handler_spec.rb",
79
+ "spec/rspec/matchers/be_close_spec.rb",
80
+ "spec/rspec/matchers/be_instance_of_spec.rb",
81
+ "spec/rspec/matchers/be_kind_of_spec.rb",
82
+ "spec/rspec/matchers/be_spec.rb",
83
+ "spec/rspec/matchers/change_spec.rb",
84
+ "spec/rspec/matchers/compatibility_spec.rb",
85
+ "spec/rspec/matchers/description_generation_spec.rb",
86
+ "spec/rspec/matchers/dsl_spec.rb",
87
+ "spec/rspec/matchers/eq_spec.rb",
88
+ "spec/rspec/matchers/eql_spec.rb",
89
+ "spec/rspec/matchers/equal_spec.rb",
90
+ "spec/rspec/matchers/exist_spec.rb",
91
+ "spec/rspec/matchers/has_spec.rb",
92
+ "spec/rspec/matchers/have_spec.rb",
93
+ "spec/rspec/matchers/include_spec.rb",
94
+ "spec/rspec/matchers/match_array_spec.rb",
95
+ "spec/rspec/matchers/match_spec.rb",
96
+ "spec/rspec/matchers/matcher_spec.rb",
97
+ "spec/rspec/matchers/matchers_spec.rb",
98
+ "spec/rspec/matchers/operator_matcher_spec.rb",
99
+ "spec/rspec/matchers/raise_error_spec.rb",
100
+ "spec/rspec/matchers/respond_to_spec.rb",
101
+ "spec/rspec/matchers/satisfy_spec.rb",
102
+ "spec/rspec/matchers/throw_symbol_spec.rb",
103
+ "spec/spec_helper.rb",
104
+ "spec/suite.rb",
105
+ "spec/support/classes.rb"
106
+ ]
107
+ s.homepage = %q{http://github.com/rspec/expectations}
108
+ s.post_install_message = %q{**************************************************
109
+
110
+ Thank you for installing rspec-expectations-2.0.0.beta.3
111
+
112
+ This is beta software. If you are looking
113
+ for a supported production release, please
114
+ "gem install rspec" (without --pre).
115
+
116
+ **************************************************
117
+ }
118
+ s.rdoc_options = ["--charset=UTF-8"]
119
+ s.require_paths = ["lib"]
120
+ s.rubyforge_project = %q{rspec}
121
+ s.rubygems_version = %q{1.3.6}
122
+ s.summary = %q{rspec-expectations-2.0.0.beta.3}
123
+ s.test_files = [
124
+ "spec/rspec/expectations/differs/default_spec.rb",
125
+ "spec/rspec/expectations/extensions/kernel_spec.rb",
126
+ "spec/rspec/expectations/fail_with_spec.rb",
127
+ "spec/rspec/expectations/handler_spec.rb",
128
+ "spec/rspec/matchers/be_close_spec.rb",
129
+ "spec/rspec/matchers/be_instance_of_spec.rb",
130
+ "spec/rspec/matchers/be_kind_of_spec.rb",
131
+ "spec/rspec/matchers/be_spec.rb",
132
+ "spec/rspec/matchers/change_spec.rb",
133
+ "spec/rspec/matchers/compatibility_spec.rb",
134
+ "spec/rspec/matchers/description_generation_spec.rb",
135
+ "spec/rspec/matchers/dsl_spec.rb",
136
+ "spec/rspec/matchers/eq_spec.rb",
137
+ "spec/rspec/matchers/eql_spec.rb",
138
+ "spec/rspec/matchers/equal_spec.rb",
139
+ "spec/rspec/matchers/exist_spec.rb",
140
+ "spec/rspec/matchers/has_spec.rb",
141
+ "spec/rspec/matchers/have_spec.rb",
142
+ "spec/rspec/matchers/include_spec.rb",
143
+ "spec/rspec/matchers/match_array_spec.rb",
144
+ "spec/rspec/matchers/match_spec.rb",
145
+ "spec/rspec/matchers/matcher_spec.rb",
146
+ "spec/rspec/matchers/matchers_spec.rb",
147
+ "spec/rspec/matchers/operator_matcher_spec.rb",
148
+ "spec/rspec/matchers/raise_error_spec.rb",
149
+ "spec/rspec/matchers/respond_to_spec.rb",
150
+ "spec/rspec/matchers/satisfy_spec.rb",
151
+ "spec/rspec/matchers/throw_symbol_spec.rb",
152
+ "spec/spec_helper.rb",
153
+ "spec/suite.rb",
154
+ "spec/support/classes.rb"
155
+ ]
156
+
157
+ if s.respond_to? :specification_version then
158
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
159
+ s.specification_version = 3
160
+
161
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
162
+ s.add_development_dependency(%q<cucumber>, [">= 0.6.2"])
163
+ s.add_development_dependency(%q<aruba>, [">= 0.1.1"])
164
+ s.add_development_dependency(%q<rspec-core>, [">= 2.0.0.beta.3"])
165
+ s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.3"])
166
+ else
167
+ s.add_dependency(%q<cucumber>, [">= 0.6.2"])
168
+ s.add_dependency(%q<aruba>, [">= 0.1.1"])
169
+ s.add_dependency(%q<rspec-core>, [">= 2.0.0.beta.3"])
170
+ s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.3"])
171
+ end
172
+ else
173
+ s.add_dependency(%q<cucumber>, [">= 0.6.2"])
174
+ s.add_dependency(%q<aruba>, [">= 0.1.1"])
175
+ s.add_dependency(%q<rspec-core>, [">= 2.0.0.beta.3"])
176
+ s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.3"])
177
+ end
178
+ end
179
+
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 0
9
9
  - beta
10
- - 2
11
- version: 2.0.0.beta.2
10
+ - 3
11
+ version: 2.0.0.beta.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - David Chelimsky
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-04 00:00:00 -06:00
20
+ date: 2010-03-08 00:00:00 -06:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -60,8 +60,8 @@ dependencies:
60
60
  - 0
61
61
  - 0
62
62
  - beta
63
- - 2
64
- version: 2.0.0.beta.2
63
+ - 3
64
+ version: 2.0.0.beta.3
65
65
  type: :development
66
66
  version_requirements: *id003
67
67
  - !ruby/object:Gem::Dependency
@@ -76,8 +76,8 @@ dependencies:
76
76
  - 0
77
77
  - 0
78
78
  - beta
79
- - 2
80
- version: 2.0.0.beta.2
79
+ - 3
80
+ version: 2.0.0.beta.3
81
81
  type: :development
82
82
  version_requirements: *id004
83
83
  description: rspec expectations (should[_not] and matchers)
@@ -96,9 +96,15 @@ files:
96
96
  - Rakefile
97
97
  - Upgrade.markdown
98
98
  - VERSION
99
+ - cucumber.yml
99
100
  - features/expectations/customized_message.feature
101
+ - features/expectations/implicit_docstrings.feature
102
+ - features/matchers/define_diffable_matcher.feature
100
103
  - features/matchers/define_matcher.feature
101
104
  - features/matchers/define_matcher_outside_rspec.feature
105
+ - features/matchers/define_matcher_with_fluent_interface.feature
106
+ - features/matchers/expect_change.feature
107
+ - features/matchers/expect_error.feature
102
108
  - features/support/env.rb
103
109
  - lib/rspec/expectations.rb
104
110
  - lib/rspec/expectations/differs/default.rb
@@ -138,6 +144,7 @@ files:
138
144
  - lib/rspec/matchers/respond_to.rb
139
145
  - lib/rspec/matchers/satisfy.rb
140
146
  - lib/rspec/matchers/throw_symbol.rb
147
+ - rspec-expectations.gemspec
141
148
  - spec/rspec/expectations/differs/default_spec.rb
142
149
  - spec/rspec/expectations/extensions/kernel_spec.rb
143
150
  - spec/rspec/expectations/fail_with_spec.rb
@@ -176,7 +183,7 @@ licenses: []
176
183
  post_install_message: |
177
184
  **************************************************
178
185
 
179
- Thank you for installing rspec-expectations-2.0.0.beta.2
186
+ Thank you for installing rspec-expectations-2.0.0.beta.3
180
187
 
181
188
  This is beta software. If you are looking
182
189
  for a supported production release, please
@@ -210,7 +217,7 @@ rubyforge_project: rspec
210
217
  rubygems_version: 1.3.6
211
218
  signing_key:
212
219
  specification_version: 3
213
- summary: rspec-expectations-2.0.0.beta.2
220
+ summary: rspec-expectations-2.0.0.beta.3
214
221
  test_files:
215
222
  - spec/rspec/expectations/differs/default_spec.rb
216
223
  - spec/rspec/expectations/extensions/kernel_spec.rb