From a17df45fc3909c48099393eb44b419881107280c Mon Sep 17 00:00:00 2001 From: Matt Aimonetti Date: Sat, 1 Aug 2009 14:21:18 -0700 Subject: [PATCH] made all the specs run on 1.9.2, yay :) --- lib/couchrest/more/casted_model.rb | 3 ++- spec/couchrest/core/couchrest_spec.rb | 2 +- spec/couchrest/core/database_spec.rb | 8 ++++++-- spec/couchrest/core/design_spec.rb | 2 +- spec/couchrest/core/document_spec.rb | 2 +- spec/couchrest/core/server_spec.rb | 2 +- spec/couchrest/helpers/pager_spec.rb | 2 +- spec/couchrest/helpers/streamer_spec.rb | 2 +- spec/couchrest/more/casted_extended_doc_spec.rb | 2 +- spec/couchrest/more/casted_model_spec.rb | 2 +- spec/couchrest/more/extended_doc_attachment_spec.rb | 2 +- spec/couchrest/more/extended_doc_spec.rb | 2 +- spec/couchrest/more/extended_doc_subclass_spec.rb | 2 +- spec/couchrest/more/extended_doc_view_spec.rb | 5 +++-- spec/couchrest/more/property_spec.rb | 2 +- 15 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lib/couchrest/more/casted_model.rb b/lib/couchrest/more/casted_model.rb index 5e4da2e..5b8d383 100644 --- a/lib/couchrest/more/casted_model.rb +++ b/lib/couchrest/more/casted_model.rb @@ -1,4 +1,5 @@ -require File.join(File.dirname(__FILE__), '..', 'mixins', 'properties') +require File.expand_path('../../mixins/properties', __FILE__) + module CouchRest module CastedModel diff --git a/spec/couchrest/core/couchrest_spec.rb b/spec/couchrest/core/couchrest_spec.rb index 35e48e6..ef6637c 100644 --- a/spec/couchrest/core/couchrest_spec.rb +++ b/spec/couchrest/core/couchrest_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) describe CouchRest do diff --git a/spec/couchrest/core/database_spec.rb b/spec/couchrest/core/database_spec.rb index d1c58ad..98b7947 100644 --- a/spec/couchrest/core/database_spec.rb +++ b/spec/couchrest/core/database_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) describe CouchRest::Database do before(:each) do @@ -263,7 +263,11 @@ describe CouchRest::Database do r['ok'].should == true doc = @db.get("attach-this") attachment = @db.fetch_attachment(doc,"couchdb.png") - attachment.should == image + if attachment.respond_to?(:net_http_res) + attachment.net_http_res.body.should == image + else + attachment.should == image + end end end diff --git a/spec/couchrest/core/design_spec.rb b/spec/couchrest/core/design_spec.rb index 8b367c7..b5b2ce1 100644 --- a/spec/couchrest/core/design_spec.rb +++ b/spec/couchrest/core/design_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) describe CouchRest::Design do diff --git a/spec/couchrest/core/document_spec.rb b/spec/couchrest/core/document_spec.rb index e83c05f..287ee79 100644 --- a/spec/couchrest/core/document_spec.rb +++ b/spec/couchrest/core/document_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) class Video < CouchRest::Document; end diff --git a/spec/couchrest/core/server_spec.rb b/spec/couchrest/core/server_spec.rb index 5e0f1f7..f55dd29 100644 --- a/spec/couchrest/core/server_spec.rb +++ b/spec/couchrest/core/server_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) describe CouchRest::Server do diff --git a/spec/couchrest/helpers/pager_spec.rb b/spec/couchrest/helpers/pager_spec.rb index ed16df3..3c111f6 100644 --- a/spec/couchrest/helpers/pager_spec.rb +++ b/spec/couchrest/helpers/pager_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) describe CouchRest::Pager do before(:all) do diff --git a/spec/couchrest/helpers/streamer_spec.rb b/spec/couchrest/helpers/streamer_spec.rb index 5479390..cf828ca 100644 --- a/spec/couchrest/helpers/streamer_spec.rb +++ b/spec/couchrest/helpers/streamer_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) describe CouchRest::Streamer do before(:all) do diff --git a/spec/couchrest/more/casted_extended_doc_spec.rb b/spec/couchrest/more/casted_extended_doc_spec.rb index 51afd77..6e3e13c 100644 --- a/spec/couchrest/more/casted_extended_doc_spec.rb +++ b/spec/couchrest/more/casted_extended_doc_spec.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') +require File.expand_path('../../../spec_helper', __FILE__) require File.join(FIXTURE_PATH, 'more', 'card') class Car < CouchRest::ExtendedDocument diff --git a/spec/couchrest/more/casted_model_spec.rb b/spec/couchrest/more/casted_model_spec.rb index 75b0c57..c1de242 100644 --- a/spec/couchrest/more/casted_model_spec.rb +++ b/spec/couchrest/more/casted_model_spec.rb @@ -1,6 +1,6 @@ # encoding: utf-8 -require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') +require File.expand_path('../../../spec_helper', __FILE__) require File.join(FIXTURE_PATH, 'more', 'card') require File.join(FIXTURE_PATH, 'more', 'cat') require File.join(FIXTURE_PATH, 'more', 'person') diff --git a/spec/couchrest/more/extended_doc_attachment_spec.rb b/spec/couchrest/more/extended_doc_attachment_spec.rb index d82d9fe..e73db96 100644 --- a/spec/couchrest/more/extended_doc_attachment_spec.rb +++ b/spec/couchrest/more/extended_doc_attachment_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path('../../../spec_helper', __FILE__) describe "ExtendedDocument attachments" do diff --git a/spec/couchrest/more/extended_doc_spec.rb b/spec/couchrest/more/extended_doc_spec.rb index f3097ff..1b05bc3 100644 --- a/spec/couchrest/more/extended_doc_spec.rb +++ b/spec/couchrest/more/extended_doc_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) require File.join(FIXTURE_PATH, 'more', 'article') require File.join(FIXTURE_PATH, 'more', 'course') diff --git a/spec/couchrest/more/extended_doc_subclass_spec.rb b/spec/couchrest/more/extended_doc_subclass_spec.rb index ef31a7a..6a9bdc9 100644 --- a/spec/couchrest/more/extended_doc_subclass_spec.rb +++ b/spec/couchrest/more/extended_doc_subclass_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) require File.join(FIXTURE_PATH, 'more', 'card') require File.join(FIXTURE_PATH, 'more', 'course') diff --git a/spec/couchrest/more/extended_doc_view_spec.rb b/spec/couchrest/more/extended_doc_view_spec.rb index be6056e..f532e95 100644 --- a/spec/couchrest/more/extended_doc_view_spec.rb +++ b/spec/couchrest/more/extended_doc_view_spec.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require File.expand_path("../../../spec_helper", __FILE__) require File.join(FIXTURE_PATH, 'more', 'article') require File.join(FIXTURE_PATH, 'more', 'course') @@ -354,7 +354,8 @@ describe "ExtendedDocument views" do a = Article.new(:title => title, :date => Date.today) a.save end - end + end + require 'date' it "should return a proxy that looks like an array of 7 Article objects" do articles = Article.by_date :key => Date.today articles.class.should == Array diff --git a/spec/couchrest/more/property_spec.rb b/spec/couchrest/more/property_spec.rb index efeba94..126d86f 100644 --- a/spec/couchrest/more/property_spec.rb +++ b/spec/couchrest/more/property_spec.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') +require File.expand_path('../../../spec_helper', __FILE__) require File.join(FIXTURE_PATH, 'more', 'person') require File.join(FIXTURE_PATH, 'more', 'card') require File.join(FIXTURE_PATH, 'more', 'invoice')