diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-07-28 12:03:16 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-28 12:03:16 +0100 |
commit | de211914d84737c4314e862b459b9a23a0baa28f (patch) | |
tree | 3f04c940a4c821014332ddc4f119a81a37db3a33 /activeresource | |
parent | 6246a8e06035973c88a38826ce1ee6b07b03b8dc (diff) | |
parent | 10d9fe4bf3110c1d5de0c6b509fe0cbb9d5eda1d (diff) | |
download | rails-de211914d84737c4314e862b459b9a23a0baa28f.tar.gz rails-de211914d84737c4314e862b459b9a23a0baa28f.tar.bz2 rails-de211914d84737c4314e862b459b9a23a0baa28f.zip |
Merge commit 'mainstream/master'
Conflicts:
actionpack/lib/action_controller/cookies.rb
actionpack/lib/action_controller/streaming.rb
actionpack/lib/action_controller/test_case.rb
actionpack/lib/action_view/base.rb
actionpack/lib/action_view/helpers/date_helper.rb
actionpack/lib/action_view/helpers/debug_helper.rb
actionpack/lib/action_view/helpers/form_options_helper.rb
actionpack/lib/action_view/helpers/javascript_helper.rb
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/validations.rb
activeresource/README
activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone_info.rb
activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone.rb
railties/doc/guides/actionview/helpers.markdown
railties/doc/guides/actionview/partials.markdown
railties/doc/guides/activerecord/basics.markdown
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/README | 2 | ||||
-rw-r--r-- | activeresource/test/abstract_unit.rb | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/activeresource/README b/activeresource/README index f51b09cd44..924017a659 100644 --- a/activeresource/README +++ b/activeresource/README @@ -37,7 +37,7 @@ lifecycle methods that operate against a persistent store. Person.exists?(1) #=> true As you can see, the methods are quite similar to Active Record's methods for dealing with database -records. But rather than dealing directly with a database record, you're dealing with HTTP resources (which may or may not be database records). +records. But rather than dealing directly with a database record, you're dealing with HTTP resources (which may or may not be database records). ==== Protocol diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb index 615a6d9222..e612412033 100644 --- a/activeresource/test/abstract_unit.rb +++ b/activeresource/test/abstract_unit.rb @@ -9,14 +9,18 @@ require 'setter_trap' ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log") +def uses_gem(gem_name, test_name, version = '> 0') + require 'rubygems' + gem gem_name.to_s, version + require gem_name.to_s + yield +rescue LoadError + $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." +end + # Wrap tests that use Mocha and skip if unavailable. -def uses_mocha(test_name) - unless Object.const_defined?(:Mocha) - require 'mocha' - require 'stubba' +unless defined? uses_mocha + def uses_mocha(test_name, &block) + uses_gem('mocha', test_name, '>= 0.5.5', &block) end - yield -rescue LoadError => load_error - raise unless load_error.message =~ /mocha/i - $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again." -end
\ No newline at end of file +end |