Skip to content

Commit

Permalink
bangless default
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Mar 16, 2010
1 parent 8d6e005 commit 723cdf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/mocks/methods.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def should_not_receive(sym, &block)
__mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block) __mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block)
end end


def stub!(sym_or_hash, opts={}, &block) def stub(sym_or_hash, opts={}, &block)
if Hash === sym_or_hash if Hash === sym_or_hash
sym_or_hash.each {|method, value| stub!(method).and_return value } sym_or_hash.each {|method, value| stub!(method).and_return value }
else else
__mock_proxy.add_stub(caller(1)[0], sym_or_hash.to_sym, opts, &block) __mock_proxy.add_stub(caller(1)[0], sym_or_hash.to_sym, opts, &block)
end end
end end


alias_method :stub, :stub! alias_method :stub!, :stub


def stub_chain(*methods) def stub_chain(*methods)
if methods.length > 1 if methods.length > 1
Expand Down
8 changes: 5 additions & 3 deletions rspec-mocks.gemspec
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|


s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["David Chelimsky", "Chad Humphries"] s.authors = ["David Chelimsky", "Chad Humphries"]
s.date = %q{2010-03-15} s.date = %q{2010-03-16}
s.description = %q{Rspec's 'test double' framework, with support for stubbing and mocking} s.description = %q{Rspec's 'test double' framework, with support for stubbing and mocking}
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com} s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
s.extra_rdoc_files = [ s.extra_rdoc_files = [
Expand All @@ -27,6 +27,7 @@ Gem::Specification.new do |s|
"cucumber.yml", "cucumber.yml",
"features/mocks/block_local_expectations.feature", "features/mocks/block_local_expectations.feature",
"features/mocks/mix_stubs_and_mocks.feature", "features/mocks/mix_stubs_and_mocks.feature",
"features/mocks/warn_when_expectation_is_set_on_nil.feature",
"features/stubs/stub_implementation.feature", "features/stubs/stub_implementation.feature",
"features/support/env.rb", "features/support/env.rb",
"lib/rspec/mocks.rb", "lib/rspec/mocks.rb",
Expand All @@ -39,6 +40,7 @@ Gem::Specification.new do |s|
"lib/rspec/mocks/extensions/object.rb", "lib/rspec/mocks/extensions/object.rb",
"lib/rspec/mocks/framework.rb", "lib/rspec/mocks/framework.rb",
"lib/rspec/mocks/message_expectation.rb", "lib/rspec/mocks/message_expectation.rb",
"lib/rspec/mocks/method_double.rb",
"lib/rspec/mocks/methods.rb", "lib/rspec/mocks/methods.rb",
"lib/rspec/mocks/mock.rb", "lib/rspec/mocks/mock.rb",
"lib/rspec/mocks/order_group.rb", "lib/rspec/mocks/order_group.rb",
Expand Down Expand Up @@ -108,7 +110,8 @@ Gem::Specification.new do |s|
s.rubygems_version = %q{1.3.6} s.rubygems_version = %q{1.3.6}
s.summary = %q{rspec-mocks-2.0.0.beta.4} s.summary = %q{rspec-mocks-2.0.0.beta.4}
s.test_files = [ s.test_files = [
"spec/rspec/mocks/and_yield_spec.rb", "spec/spec_helper.rb",
"spec/rspec/mocks/and_yield_spec.rb",
"spec/rspec/mocks/any_number_of_times_spec.rb", "spec/rspec/mocks/any_number_of_times_spec.rb",
"spec/rspec/mocks/argument_expectation_spec.rb", "spec/rspec/mocks/argument_expectation_spec.rb",
"spec/rspec/mocks/at_least_spec.rb", "spec/rspec/mocks/at_least_spec.rb",
Expand Down Expand Up @@ -147,7 +150,6 @@ Gem::Specification.new do |s|
"spec/rspec/mocks/stub_spec.rb", "spec/rspec/mocks/stub_spec.rb",
"spec/rspec/mocks/stubbed_message_expectations_spec.rb", "spec/rspec/mocks/stubbed_message_expectations_spec.rb",
"spec/rspec/mocks/twice_counts_spec.rb", "spec/rspec/mocks/twice_counts_spec.rb",
"spec/spec_helper.rb",
"spec/support/macros.rb" "spec/support/macros.rb"
] ]


Expand Down

0 comments on commit 723cdf1

Please sign in to comment.