mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 12:08:47 +01:00
* Ran rake rails:update * Added old actionwebservice framework * Updated RSpec and RSpec-Rails * Removed asset_packager plugin (not compatible, Scott no longer maintaining), and replaced with bundle_fu. See the bundle_fu README for more info. * Hacks to UJS and ARTS plugins, which are no longer supported. Probably should move off both UJS and RJS. * Hack to flashobject_helper plugin (upgrade to Rails 2.2-compatible version if/when it comes out.) * Hack to skinny-spec plugin, for Rails 2.2 compatibility. Should check for official release. * Hacks to resource_feeder plugin, for Rails 2.2 compatibility. Should check for official release (not likely) or move off it. * Addressed some deprecation warnings. More to come. * My mobile mime type hackery is no longer necessary with new Rails features. Yay! * Updated environment.rb.tmpl with changes TODO: * Restore view specs marked pending * Fix failing integration tests. * Try selenium tests. * Investigate OpenID support. * Address deprecation warnings. * Consider moving parts of environment.rb to initializers * Address annoying config.gem warning about highline gem
51 lines
1.2 KiB
Ruby
51 lines
1.2 KiB
Ruby
module Spec
|
|
module Mocks
|
|
module Methods
|
|
def should_receive(sym, opts={}, &block)
|
|
__mock_proxy.add_message_expectation(opts[:expected_from] || caller(1)[0], sym.to_sym, opts, &block)
|
|
end
|
|
|
|
def should_not_receive(sym, &block)
|
|
__mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block)
|
|
end
|
|
|
|
def stub!(sym_or_hash, opts={})
|
|
if Hash === sym_or_hash
|
|
sym_or_hash.each {|method, value| stub!(method).and_return value }
|
|
else
|
|
__mock_proxy.add_stub(caller(1)[0], sym_or_hash.to_sym, opts)
|
|
end
|
|
end
|
|
|
|
def received_message?(sym, *args, &block) #:nodoc:
|
|
__mock_proxy.received_message?(sym.to_sym, *args, &block)
|
|
end
|
|
|
|
def rspec_verify #:nodoc:
|
|
__mock_proxy.verify
|
|
end
|
|
|
|
def rspec_reset #:nodoc:
|
|
__mock_proxy.reset
|
|
end
|
|
|
|
def as_null_object
|
|
__mock_proxy.as_null_object
|
|
end
|
|
|
|
def null_object?
|
|
__mock_proxy.null_object?
|
|
end
|
|
|
|
private
|
|
|
|
def __mock_proxy
|
|
if Mock === self
|
|
@mock_proxy ||= Proxy.new(self, @name, @options)
|
|
else
|
|
@mock_proxy ||= Proxy.new(self)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|