rspec-mocks 2.0.0.beta.3 → 2.0.0.beta.4

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.
@@ -0,0 +1,6 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ at.add_mapping(%r%^lib/.*\.rb$%) {
3
+ at.files_matching %r%^spec/.*\_spec.rb$%
4
+ }
5
+ end
6
+
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ rdoc
5
5
  pkg
6
6
  doc
7
7
  tmp
8
+ rerun.txt
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.beta.3
1
+ 2.0.0.beta.4
@@ -0,0 +1 @@
1
+ Autotest.add_discovery { "rspec2" }
@@ -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
@@ -0,0 +1,30 @@
1
+ Feature: stub implementation
2
+
3
+ As an rspec user, I want to stub a complete implementation, not just a
4
+ return value.
5
+
6
+ Scenario: stub implementation
7
+ Given a file named "stub_implementation_spec.rb" with:
8
+ """
9
+ Rspec.configure do |c|
10
+ c.mock_with :rspec
11
+ end
12
+
13
+ describe "a stubbed implementation" do
14
+ it "works" do
15
+ object = Object.new
16
+ object.stub(:foo) do |arg|
17
+ if arg == :this
18
+ "got this"
19
+ elsif arg == :that
20
+ "got that"
21
+ end
22
+ end
23
+
24
+ object.foo(:this).should == "got this"
25
+ object.foo(:that).should == "got that"
26
+ end
27
+ end
28
+ """
29
+ When I run "rspec stub_implementation_spec.rb"
30
+ Then I should see "1 example, 0 failures"
@@ -5,25 +5,29 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rspec-mocks}
8
- s.version = "2.0.0.beta.3"
8
+ s.version = "2.0.0.beta.4"
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 = ["David Chelimsky", "Chad Humphries"]
12
- s.date = %q{2010-03-08}
12
+ s.date = %q{2010-03-15}
13
13
  s.description = %q{Rspec's 'test double' framework, with support for stubbing and mocking}
14
14
  s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.markdown"
17
17
  ]
18
18
  s.files = [
19
- ".document",
19
+ ".autotest",
20
+ ".document",
20
21
  ".gitignore",
21
22
  "License.txt",
22
23
  "README.markdown",
23
24
  "Rakefile",
24
25
  "VERSION",
26
+ "autotest/discover.rb",
27
+ "cucumber.yml",
25
28
  "features/mocks/block_local_expectations.feature",
26
29
  "features/mocks/mix_stubs_and_mocks.feature",
30
+ "features/stubs/stub_implementation.feature",
27
31
  "features/support/env.rb",
28
32
  "lib/rspec/mocks.rb",
29
33
  "lib/rspec/mocks/argument_expectation.rb",
@@ -84,12 +88,13 @@ Gem::Specification.new do |s|
84
88
  "spec/rspec/mocks/stubbed_message_expectations_spec.rb",
85
89
  "spec/rspec/mocks/twice_counts_spec.rb",
86
90
  "spec/spec_helper.rb",
87
- "spec/support/macros.rb"
91
+ "spec/support/macros.rb",
92
+ "specs.watchr"
88
93
  ]
89
94
  s.homepage = %q{http://github.com/rspec/mocks}
90
95
  s.post_install_message = %q{**************************************************
91
96
 
92
- Thank you for installing rspec-mocks-2.0.0.beta.3
97
+ Thank you for installing rspec-mocks-2.0.0.beta.4
93
98
 
94
99
  This is beta software. If you are looking
95
100
  for a supported production release, please
@@ -101,7 +106,7 @@ Gem::Specification.new do |s|
101
106
  s.require_paths = ["lib"]
102
107
  s.rubyforge_project = %q{rspec}
103
108
  s.rubygems_version = %q{1.3.6}
104
- s.summary = %q{rspec-mocks-2.0.0.beta.3}
109
+ s.summary = %q{rspec-mocks-2.0.0.beta.4}
105
110
  s.test_files = [
106
111
  "spec/rspec/mocks/and_yield_spec.rb",
107
112
  "spec/rspec/mocks/any_number_of_times_spec.rb",
@@ -151,15 +156,15 @@ Gem::Specification.new do |s|
151
156
  s.specification_version = 3
152
157
 
153
158
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
154
- s.add_development_dependency(%q<rspec-core>, ["= 2.0.0.beta.3"])
155
- s.add_development_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.3"])
159
+ s.add_development_dependency(%q<rspec-core>, ["= 2.0.0.beta.4"])
160
+ s.add_development_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.4"])
156
161
  else
157
- s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.3"])
158
- s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.3"])
162
+ s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.4"])
163
+ s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.4"])
159
164
  end
160
165
  else
161
- s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.3"])
162
- s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.3"])
166
+ s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.4"])
167
+ s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.4"])
163
168
  end
164
169
  end
165
170
 
@@ -0,0 +1,57 @@
1
+ # Run me with:
2
+ #
3
+ # $ watchr specs.watchr
4
+
5
+ # --------------------------------------------------
6
+ # Convenience Methods
7
+ # --------------------------------------------------
8
+ def all_test_files
9
+ Dir['spec/**/*_spec.rb']
10
+ end
11
+
12
+ def run_test_matching(thing_to_match)
13
+ matches = all_test_files.grep(/#{thing_to_match}/i)
14
+ if matches.empty?
15
+ puts "Sorry, thanks for playing, but there were no matches for #{thing_to_match}"
16
+ else
17
+ run matches.join(' ')
18
+ end
19
+ end
20
+
21
+ def run(files_to_run)
22
+ puts("Running: #{files_to_run}")
23
+ system("clear;rspec -cfs #{files_to_run}")
24
+ no_int_for_you
25
+ end
26
+
27
+ def run_all
28
+ run(all_test_files.join(' '))
29
+ end
30
+
31
+ # --------------------------------------------------
32
+ # Watchr Rules
33
+ # --------------------------------------------------
34
+ watch('^spec/(.*)_spec\.rb') { run_all }
35
+ watch('^lib/(.*)\.rb') { run_all }
36
+
37
+ # --------------------------------------------------
38
+ # Signal Handling
39
+ # --------------------------------------------------
40
+
41
+ def no_int_for_you
42
+ @sent_an_int = nil
43
+ end
44
+
45
+ Signal.trap 'INT' do
46
+ if @sent_an_int then
47
+ puts " A second INT? Ok, I get the message. Shutting down now."
48
+ exit
49
+ else
50
+ puts " Did you just send me an INT? Ugh. I'll quit for real if you do it again."
51
+ @sent_an_int = true
52
+ Kernel.sleep 1.5
53
+ run_all
54
+ end
55
+ end
56
+
57
+ # vim:ft=ruby
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 0
9
9
  - beta
10
- - 3
11
- version: 2.0.0.beta.3
10
+ - 4
11
+ version: 2.0.0.beta.4
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-08 00:00:00 -06:00
20
+ date: 2010-03-15 00:00:00 -05:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -32,8 +32,8 @@ dependencies:
32
32
  - 0
33
33
  - 0
34
34
  - beta
35
- - 3
36
- version: 2.0.0.beta.3
35
+ - 4
36
+ version: 2.0.0.beta.4
37
37
  type: :development
38
38
  version_requirements: *id001
39
39
  - !ruby/object:Gem::Dependency
@@ -48,8 +48,8 @@ dependencies:
48
48
  - 0
49
49
  - 0
50
50
  - beta
51
- - 3
52
- version: 2.0.0.beta.3
51
+ - 4
52
+ version: 2.0.0.beta.4
53
53
  type: :development
54
54
  version_requirements: *id002
55
55
  description: Rspec's 'test double' framework, with support for stubbing and mocking
@@ -61,14 +61,18 @@ extensions: []
61
61
  extra_rdoc_files:
62
62
  - README.markdown
63
63
  files:
64
+ - .autotest
64
65
  - .document
65
66
  - .gitignore
66
67
  - License.txt
67
68
  - README.markdown
68
69
  - Rakefile
69
70
  - VERSION
71
+ - autotest/discover.rb
72
+ - cucumber.yml
70
73
  - features/mocks/block_local_expectations.feature
71
74
  - features/mocks/mix_stubs_and_mocks.feature
75
+ - features/stubs/stub_implementation.feature
72
76
  - features/support/env.rb
73
77
  - lib/rspec/mocks.rb
74
78
  - lib/rspec/mocks/argument_expectation.rb
@@ -130,6 +134,7 @@ files:
130
134
  - spec/rspec/mocks/twice_counts_spec.rb
131
135
  - spec/spec_helper.rb
132
136
  - spec/support/macros.rb
137
+ - specs.watchr
133
138
  has_rdoc: true
134
139
  homepage: http://github.com/rspec/mocks
135
140
  licenses: []
@@ -137,7 +142,7 @@ licenses: []
137
142
  post_install_message: |
138
143
  **************************************************
139
144
 
140
- Thank you for installing rspec-mocks-2.0.0.beta.3
145
+ Thank you for installing rspec-mocks-2.0.0.beta.4
141
146
 
142
147
  This is beta software. If you are looking
143
148
  for a supported production release, please
@@ -171,7 +176,7 @@ rubyforge_project: rspec
171
176
  rubygems_version: 1.3.6
172
177
  signing_key:
173
178
  specification_version: 3
174
- summary: rspec-mocks-2.0.0.beta.3
179
+ summary: rspec-mocks-2.0.0.beta.4
175
180
  test_files:
176
181
  - spec/rspec/mocks/and_yield_spec.rb
177
182
  - spec/rspec/mocks/any_number_of_times_spec.rb