rspec-mocks 2.6.0 → 2.7.0

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.
Files changed (69) hide show
  1. data/README.md +0 -19
  2. data/features/Scope.md +17 -0
  3. data/features/argument_matchers/README.md +27 -0
  4. data/features/argument_matchers/explicit.feature +60 -0
  5. data/features/argument_matchers/general_matchers.feature +85 -0
  6. data/features/argument_matchers/type_matchers.feature +25 -0
  7. data/features/message_expectations/any_instance.feature +2 -0
  8. data/features/message_expectations/receive_counts.feature +209 -0
  9. data/features/method_stubs/README.md +6 -10
  10. data/features/method_stubs/any_instance.feature +111 -1
  11. data/features/method_stubs/simple_return_value.feature +34 -25
  12. data/features/method_stubs/stub_implementation.feature +1 -1
  13. data/features/method_stubs/to_ary.feature +12 -10
  14. data/features/support/env.rb +1 -1
  15. data/lib/rspec/mocks/any_instance/chain.rb +49 -0
  16. data/lib/rspec/mocks/any_instance/expectation_chain.rb +33 -0
  17. data/lib/rspec/mocks/any_instance/message_chains.rb +48 -0
  18. data/lib/rspec/mocks/any_instance/recorder.rb +168 -0
  19. data/lib/rspec/mocks/any_instance/stub_chain.rb +35 -0
  20. data/lib/rspec/mocks/any_instance/stub_chain_chain.rb +34 -0
  21. data/lib/rspec/mocks/any_instance.rb +8 -235
  22. data/lib/rspec/mocks/argument_expectation.rb +1 -1
  23. data/lib/rspec/mocks/argument_matchers.rb +19 -25
  24. data/lib/rspec/mocks/extensions/marshal.rb +1 -1
  25. data/lib/rspec/mocks/extensions/psych.rb +1 -1
  26. data/lib/rspec/mocks/message_expectation.rb +7 -4
  27. data/lib/rspec/mocks/methods.rb +6 -8
  28. data/lib/rspec/mocks/mock.rb +2 -2
  29. data/lib/rspec/mocks/proxy.rb +4 -4
  30. data/lib/rspec/mocks/version.rb +4 -4
  31. data/lib/rspec/mocks.rb +13 -14
  32. data/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
  33. data/spec/rspec/mocks/any_instance_spec.rb +219 -24
  34. data/spec/rspec/mocks/any_number_of_times_spec.rb +2 -2
  35. data/spec/rspec/mocks/argument_expectation_spec.rb +15 -3
  36. data/spec/rspec/mocks/at_least_spec.rb +1 -1
  37. data/spec/rspec/mocks/at_most_spec.rb +1 -1
  38. data/spec/rspec/mocks/bug_report_10263_spec.rb +1 -1
  39. data/spec/rspec/mocks/bug_report_7611_spec.rb +1 -1
  40. data/spec/rspec/mocks/bug_report_8165_spec.rb +2 -2
  41. data/spec/rspec/mocks/bug_report_957_spec.rb +2 -2
  42. data/spec/rspec/mocks/failing_argument_matchers_spec.rb +1 -1
  43. data/spec/rspec/mocks/hash_including_matcher_spec.rb +11 -11
  44. data/spec/rspec/mocks/hash_not_including_matcher_spec.rb +6 -6
  45. data/spec/rspec/mocks/mock_spec.rb +49 -43
  46. data/spec/rspec/mocks/multiple_return_value_spec.rb +26 -26
  47. data/spec/rspec/mocks/partial_mock_spec.rb +3 -2
  48. data/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +1 -0
  49. data/spec/rspec/mocks/passing_argument_matchers_spec.rb +3 -3
  50. data/spec/rspec/mocks/precise_counts_spec.rb +1 -1
  51. data/spec/rspec/mocks/serialization_spec.rb +7 -2
  52. data/spec/rspec/mocks/stub_implementation_spec.rb +6 -6
  53. data/spec/rspec/mocks/stub_spec.rb +6 -6
  54. data/spec/rspec/mocks/to_ary_spec.rb +9 -0
  55. metadata +45 -42
  56. data/.autotest +0 -7
  57. data/.document +0 -5
  58. data/.gitignore +0 -10
  59. data/.travis.yml +0 -7
  60. data/Gemfile +0 -40
  61. data/Guardfile +0 -8
  62. data/License.txt +0 -22
  63. data/Rakefile +0 -75
  64. data/autotest/discover.rb +0 -1
  65. data/cucumber.yml +0 -2
  66. data/features/.nav +0 -17
  67. data/features/Changelog.md +0 -80
  68. data/rspec-mocks.gemspec +0 -25
  69. data/specs.watchr +0 -57
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-mocks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
- - 6
8
+ - 7
9
9
  - 0
10
- version: 2.6.0
10
+ version: 2.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Chelimsky
@@ -16,8 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-12 00:00:00 -05:00
20
- default_executable:
19
+ date: 2011-10-16 00:00:00 Z
21
20
  dependencies: []
22
21
 
23
22
  description: RSpec's 'test double' framework, with support for stubbing and mocking
@@ -29,39 +28,14 @@ extensions: []
29
28
  extra_rdoc_files:
30
29
  - README.md
31
30
  files:
32
- - .autotest
33
- - .document
34
- - .gitignore
35
- - .travis.yml
36
- - Gemfile
37
- - Guardfile
38
- - License.txt
39
- - README.md
40
- - Rakefile
41
- - autotest/discover.rb
42
- - cucumber.yml
43
- - features/.nav
44
- - features/Changelog.md
45
- - features/README.markdown
46
- - features/Upgrade.md
47
- - features/message_expectations/README.md
48
- - features/message_expectations/any_instance.feature
49
- - features/message_expectations/block_local_expectations.feature.pending
50
- - features/message_expectations/expect_message.feature
51
- - features/message_expectations/warn_when_expectation_is_set_on_nil.feature
52
- - features/method_stubs/README.md
53
- - features/method_stubs/any_instance.feature
54
- - features/method_stubs/as_null_object.feature
55
- - features/method_stubs/simple_return_value.feature
56
- - features/method_stubs/stub_chain.feature
57
- - features/method_stubs/stub_implementation.feature
58
- - features/method_stubs/to_ary.feature
59
- - features/outside_rspec/configuration.feature
60
- - features/outside_rspec/standalone.feature
61
- - features/step_definitions/additional_cli_steps.rb
62
- - features/support/env.rb
63
31
  - lib/rspec/mocks.rb
64
32
  - lib/rspec/mocks/any_instance.rb
33
+ - lib/rspec/mocks/any_instance/chain.rb
34
+ - lib/rspec/mocks/any_instance/expectation_chain.rb
35
+ - lib/rspec/mocks/any_instance/message_chains.rb
36
+ - lib/rspec/mocks/any_instance/recorder.rb
37
+ - lib/rspec/mocks/any_instance/stub_chain.rb
38
+ - lib/rspec/mocks/any_instance/stub_chain_chain.rb
65
39
  - lib/rspec/mocks/argument_expectation.rb
66
40
  - lib/rspec/mocks/argument_matchers.rb
67
41
  - lib/rspec/mocks/error_generator.rb
@@ -82,8 +56,33 @@ files:
82
56
  - lib/rspec/mocks/standalone.rb
83
57
  - lib/rspec/mocks/version.rb
84
58
  - lib/spec/mocks.rb
85
- - rspec-mocks.gemspec
59
+ - README.md
60
+ - features/README.markdown
61
+ - features/Scope.md
62
+ - features/Upgrade.md
63
+ - features/argument_matchers/README.md
64
+ - features/argument_matchers/explicit.feature
65
+ - features/argument_matchers/general_matchers.feature
66
+ - features/argument_matchers/type_matchers.feature
67
+ - features/message_expectations/README.md
68
+ - features/message_expectations/any_instance.feature
69
+ - features/message_expectations/block_local_expectations.feature.pending
70
+ - features/message_expectations/expect_message.feature
71
+ - features/message_expectations/receive_counts.feature
72
+ - features/message_expectations/warn_when_expectation_is_set_on_nil.feature
73
+ - features/method_stubs/README.md
74
+ - features/method_stubs/any_instance.feature
75
+ - features/method_stubs/as_null_object.feature
76
+ - features/method_stubs/simple_return_value.feature
77
+ - features/method_stubs/stub_chain.feature
78
+ - features/method_stubs/stub_implementation.feature
79
+ - features/method_stubs/to_ary.feature
80
+ - features/outside_rspec/configuration.feature
81
+ - features/outside_rspec/standalone.feature
82
+ - features/step_definitions/additional_cli_steps.rb
83
+ - features/support/env.rb
86
84
  - spec/rspec/mocks/and_yield_spec.rb
85
+ - spec/rspec/mocks/any_instance/message_chains_spec.rb
87
86
  - spec/rspec/mocks/any_instance_spec.rb
88
87
  - spec/rspec/mocks/any_number_of_times_spec.rb
89
88
  - spec/rspec/mocks/argument_expectation_spec.rb
@@ -126,8 +125,6 @@ files:
126
125
  - spec/rspec/mocks/twice_counts_spec.rb
127
126
  - spec/rspec/mocks_spec.rb
128
127
  - spec/spec_helper.rb
129
- - specs.watchr
130
- has_rdoc: true
131
128
  homepage: http://github.com/rspec/rspec-mocks
132
129
  licenses: []
133
130
 
@@ -157,18 +154,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
154
  requirements: []
158
155
 
159
156
  rubyforge_project: rspec
160
- rubygems_version: 1.6.2
157
+ rubygems_version: 1.8.11
161
158
  signing_key:
162
159
  specification_version: 3
163
- summary: rspec-mocks-2.6.0
160
+ summary: rspec-mocks-2.7.0
164
161
  test_files:
165
- - features/Changelog.md
166
162
  - features/README.markdown
163
+ - features/Scope.md
167
164
  - features/Upgrade.md
165
+ - features/argument_matchers/README.md
166
+ - features/argument_matchers/explicit.feature
167
+ - features/argument_matchers/general_matchers.feature
168
+ - features/argument_matchers/type_matchers.feature
168
169
  - features/message_expectations/README.md
169
170
  - features/message_expectations/any_instance.feature
170
171
  - features/message_expectations/block_local_expectations.feature.pending
171
172
  - features/message_expectations/expect_message.feature
173
+ - features/message_expectations/receive_counts.feature
172
174
  - features/message_expectations/warn_when_expectation_is_set_on_nil.feature
173
175
  - features/method_stubs/README.md
174
176
  - features/method_stubs/any_instance.feature
@@ -182,6 +184,7 @@ test_files:
182
184
  - features/step_definitions/additional_cli_steps.rb
183
185
  - features/support/env.rb
184
186
  - spec/rspec/mocks/and_yield_spec.rb
187
+ - spec/rspec/mocks/any_instance/message_chains_spec.rb
185
188
  - spec/rspec/mocks/any_instance_spec.rb
186
189
  - spec/rspec/mocks/any_number_of_times_spec.rb
187
190
  - spec/rspec/mocks/argument_expectation_spec.rb
data/.autotest DELETED
@@ -1,7 +0,0 @@
1
- Autotest.add_hook :initialize do |at|
2
- at.clear_mappings
3
- at.add_mapping(%r%\.rb$%) {
4
- at.files_matching %r%^spec/.*_spec\.rb$%
5
- }
6
- end
7
-
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.markdown
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- License.txt
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg
6
- doc
7
- tmp
8
- rerun.txt
9
- Gemfile.lock
10
- .bundle
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- script: "rake"
2
- rvm:
3
- - 1.8.6
4
- - 1.8.7
5
- - 1.9.1
6
- - 1.9.2
7
- - ree
data/Gemfile DELETED
@@ -1,40 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- ### rspec libs
4
- %w[rspec rspec-core rspec-expectations rspec-mocks].each do |lib|
5
- library_path = File.expand_path("../../#{lib}", __FILE__)
6
- if File.exist?(library_path)
7
- gem lib, :path => library_path
8
- else
9
- gem lib, :git => "git://github.com/rspec/#{lib}.git"
10
- end
11
- end
12
-
13
- ### dev dependencies
14
- gem "rake", "0.8.7"
15
- gem "cucumber", "~> 0.10.2"
16
- gem "aruba", "~> 0.3.6"
17
- gem "rcov", "0.9.9", :platforms => :mri
18
- gem "relish", "0.2.0"
19
- gem "guard-rspec", "0.1.9"
20
- gem "growl", "1.0.3"
21
- gem "nokogiri", "1.4.4"
22
-
23
- platforms :mri_18 do
24
- gem 'ruby-debug'
25
- end
26
-
27
- platforms :mri_19 do
28
- gem 'linecache19', '0.5.11' # 0.5.12 cannot install on 1.9.1, and 0.5.11 appears to work with both 1.9.1 & 1.9.2
29
- gem 'ruby-debug19'
30
- gem 'ruby-debug-base19', RUBY_VERSION == '1.9.1' ? '0.11.23' : '~> 0.11.24'
31
- end
32
-
33
- platforms :mri_18, :mri_19 do
34
- gem "rb-fsevent", "~> 0.3.9"
35
- gem "ruby-prof", "~> 0.9.2"
36
- end
37
-
38
- platforms :jruby do
39
- gem "jruby-openssl"
40
- end
data/Guardfile DELETED
@@ -1,8 +0,0 @@
1
- # A sample Guardfile
2
- # More info at http://github.com/guard/guard#readme
3
-
4
- guard 'rspec', :version => 2 do
5
- watch(/^spec\/(.*)_spec.rb/)
6
- watch(/^lib\/(.*)\.rb/) { "spec" }
7
- watch(/^spec\/spec_helper.rb/) { "spec" }
8
- end
data/License.txt DELETED
@@ -1,22 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2005 The RSpec Development Team
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,75 +0,0 @@
1
- require 'bundler'
2
- Bundler.setup
3
- Bundler::GemHelper.install_tasks
4
-
5
- require 'rake'
6
- require 'rspec/core/rake_task'
7
- require 'rspec/mocks/version'
8
-
9
- task :cleanup_rcov_files do
10
- rm_rf 'coverage.data'
11
- end
12
-
13
- desc "Run all examples"
14
- RSpec::Core::RakeTask.new(:spec) do |t|
15
- t.rspec_opts = %w[--color]
16
- end
17
-
18
- namespace :spec do
19
- desc "Run all examples using rcov"
20
- RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
21
- t.rcov = true
22
- t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
23
- t.rcov_opts << %[--text-report --sort coverage --no-html --aggregate coverage.data]
24
- end
25
- end
26
-
27
- task :default => :spec
28
-
29
- begin
30
- require 'cucumber/rake/task'
31
-
32
- class Cucumber::Rake::Task::ForkedCucumberRunner
33
- # When cucumber shells out, we still need it to run in the context of our
34
- # bundle.
35
- def run
36
- sh "bundle exec #{RUBY} " + args.join(" ")
37
- end
38
- end
39
-
40
- Cucumber::Rake::Task.new(:cucumber)
41
-
42
- namespace :cucumber do
43
- desc "Run cucumber features using rcov"
44
- Cucumber::Rake::Task.new :rcov => :cleanup_rcov_files do |t|
45
- t.cucumber_opts = %w{--format progress}
46
- t.rcov = true
47
- t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
48
- t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
49
- end
50
- end
51
-
52
- task :default => :cucumber
53
- rescue LoadError
54
- $stderr.puts "unable to load cucumber, some tasks unavailable"
55
- end
56
-
57
- task :clobber do
58
- rm_rf 'pkg'
59
- rm_rf 'tmp'
60
- rm_rf 'coverage'
61
- end
62
-
63
- require 'rake/rdoctask'
64
- Rake::RDocTask.new do |rdoc|
65
- rdoc.rdoc_dir = 'rdoc'
66
- rdoc.title = "rspec-mocks #{RSpec::Mocks::Version::STRING}"
67
- rdoc.rdoc_files.include('README*')
68
- rdoc.rdoc_files.include('lib/**/*.rb')
69
- end
70
-
71
- desc "Push docs/cukes to relishapp using the relish-client-gem"
72
- task :relish, :version do |t, args|
73
- raise "rake relish[VERSION]" unless args[:version]
74
- sh "relish push rspec/rspec-mocks:#{args[:version]}"
75
- end
data/autotest/discover.rb DELETED
@@ -1 +0,0 @@
1
- Autotest.add_discovery { "rspec2" }
data/cucumber.yml DELETED
@@ -1,2 +0,0 @@
1
- default: --require features --tags ~@wip features --format progress
2
- wip: --require features --tags @wip:3 --wip features
data/features/.nav DELETED
@@ -1,17 +0,0 @@
1
- - Upgrade.md
2
- - Changelog.md
3
- - method_stubs:
4
- - simple_return_value.feature
5
- - stub_implementation.feature
6
- - stub_chain.feature
7
- - any_instance.feature
8
- - as_null_object.feature
9
- - to_ary.feature
10
- - message_expectations:
11
- - expect_message.feature
12
- - any_instance.feature
13
- - block_local_expectations.feature.pending
14
- - warn_when_expectation_is_set_on_nil.feature
15
- - outside_rspec:
16
- - configuration.feature
17
- - standalone.feature
@@ -1,80 +0,0 @@
1
- ### 2.6.0 / 2011-05-12
2
-
3
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.5.0...v2.6.0)
4
-
5
- * Enhancements
6
- * Add support for `any_instance.stub` and `any_instance.should_receive` (Sidu
7
- Ponnappa and Andy Lindeman)
8
-
9
- * Bug fixes
10
- * fix bug in which multiple chains with shared messages ending in hashes
11
- failed to return the correct value
12
-
13
- ### 2.5.0 / 2011-02-05
14
-
15
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.4.0...v2.5.0)
16
-
17
- * Bug fixes
18
- * message expectation counts now work in combination with a stub (Damian
19
- Nurzynski)
20
- * fix failure message when message received with incorrect args (Josep M.
21
- Bach)
22
-
23
- ### 2.4.0 / 2011-01-02
24
-
25
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.3.0...v2.4.0)
26
-
27
- No functional changes in this release, which was made to align with the
28
- rspec-core-2.4.0 release.
29
-
30
- ### 2.3.0 / 2010-12-12
31
-
32
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.2.0...v2.3.0)
33
-
34
- * Bug fixes
35
- * Fix our Marshal extension so that it does not interfere with objects that
36
- have their own @mock_proxy instance variable. (Myron Marston)
37
-
38
- ### 2.2.0 / 2010-11-28
39
-
40
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.1.0...v2.2.0)
41
-
42
- * Enhancements
43
- * Added "rspec/mocks/standalone" for exploring the rspec-mocks in irb.
44
-
45
- * Bug fix
46
- * Eliminate warning on splat args without parens (Gioele Barabucci)
47
- * Fix bug where obj.should_receive(:foo).with(stub.as_null_object) would
48
- pass with a false positive.
49
-
50
- ### 2.1.0 / 2010-11-07
51
-
52
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.1...v2.1.0)
53
-
54
- * Bug fixes
55
- * Fix serialization of stubbed object (Josep M Bach)
56
-
57
- ### 2.0.0 / 2010-10-10
58
-
59
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.0.beta.22...v2.0.0)
60
-
61
- ### 2.0.0.rc / 2010-10-05
62
-
63
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.0.beta.22...v2.0.0.rc)
64
-
65
- * Enhancements
66
- * support passing a block to an expecttation block (Nicolas Braem)
67
- * obj.should_receive(:msg) {|&block| ... }
68
-
69
- * Bug fixes
70
- * Fix YAML serialization of stub (Myron Marston)
71
- * Fix rdoc rake task (Hans de Graaff)
72
-
73
- ### 2.0.0.beta.22 / 2010-09-12
74
-
75
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.0.beta.20...v2.0.0.beta.22)
76
-
77
- * Bug fixes
78
- * fixed regression that broke obj.stub_chain(:a, :b => :c)
79
- * fixed regression that broke obj.stub_chain(:a, :b) { :c }
80
- * respond_to? always returns true when using as_null_object
data/rspec-mocks.gemspec DELETED
@@ -1,25 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
3
- require "rspec/mocks/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "rspec-mocks"
7
- s.version = RSpec::Mocks::Version::STRING
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["David Chelimsky", "Chad Humphries"]
10
- s.email = "dchelimsky@gmail.com;chad.humphries@gmail.com"
11
- s.homepage = "http://github.com/rspec/rspec-mocks"
12
- s.summary = "rspec-mocks-#{RSpec::Mocks::Version::STRING}"
13
- s.description = "RSpec's 'test double' framework, with support for stubbing and mocking"
14
-
15
- s.rubygems_version = "1.3.7"
16
- s.rubyforge_project = "rspec"
17
-
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
- s.extra_rdoc_files = [ "README.md" ]
22
- s.rdoc_options = ["--charset=UTF-8"]
23
- s.require_path = "lib"
24
- end
25
-
data/specs.watchr DELETED
@@ -1,57 +0,0 @@
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