Skip to content

Commit

Permalink
Updated to pass specs when using Ruby 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Kubb committed Jan 20, 2009
1 parent 09de831 commit 8dcfcee
Show file tree
Hide file tree
Showing 70 changed files with 191 additions and 173 deletions.
10 changes: 5 additions & 5 deletions adapters/dm-couchdb-adapter/spec/couchdb_adapter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.join(File.dirname(__FILE__), 'spec_helper.rb')

if COUCHDB_AVAILABLE
class User
class ::User
include DataMapper::CouchResource
def self.default_repository_name
:couch
Expand Down Expand Up @@ -29,7 +29,7 @@ def self.default_repository_name
end
end

class Company
class ::Company
include DataMapper::CouchResource
def self.default_repository_name
:couch
Expand All @@ -42,7 +42,7 @@ def self.default_repository_name
has n, :users
end

class Person
class ::Person
include DataMapper::CouchResource
def self.default_repository_name
:couch
Expand All @@ -51,11 +51,11 @@ def self.default_repository_name
property :name, String
end

class Employee < Person
class ::Employee < Person
property :rank, String
end

class Broken
class ::Broken
include DataMapper::CouchResource
def self.default_repository_name
:couch
Expand Down
4 changes: 2 additions & 2 deletions adapters/dm-couchdb-adapter/spec/couchdb_attachments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

before do
Object.send(:remove_const, :NonCouch) if defined?(NonCouch)
class NonCouch
class ::NonCouch
include DataMapper::Resource

property :id, Serial
end

Object.send(:remove_const, :Message) if defined?(Message)
class Message
class ::Message
include DataMapper::CouchResource
def self.default_repository_name
:couch
Expand Down
2 changes: 1 addition & 1 deletion adapters/dm-couchdb-adapter/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion adapters/dm-ferret-adapter/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion adapters/dm-rest-adapter/lib/rest_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def http_put(uri, data = nil)

def http_post(uri, data)
request do |http|
request = Net::HTTP::Post.new(uri, data, {"Content-Type", "application/xml"})
request = Net::HTTP::Post.new(uri, data, 'Content-Type' => 'application/xml')
request.basic_auth(@uri[:login], @uri[:password]) unless @uri[:login].blank?
http.request(request)
end
Expand Down
2 changes: 1 addition & 1 deletion adapters/dm-rest-adapter/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-adjust/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
6 changes: 3 additions & 3 deletions dm-aggregates/spec/public/shared/aggregate_shared_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
shared_examples_for 'It Has Setup Resources' do
before :all do
# A simplistic example, using with an Integer property
class Knight
class ::Knight
include DataMapper::Resource

property :id, Serial
property :name, String
end

class Dragon
class ::Dragon
include DataMapper::Resource

property :id, Serial
Expand All @@ -25,7 +25,7 @@ class Dragon
# A more complex example, with BigDecimal and Float properties
# Statistics taken from CIA World Factbook:
# https://www.cia.gov/library/publications/the-world-factbook/
class Country
class ::Country
include DataMapper::Resource

property :id, Serial
Expand Down
2 changes: 1 addition & 1 deletion dm-aggregates/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-ar-finders/spec/integration/ar-finders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

before(:all) do
class GreenSmoothie
class ::GreenSmoothie
include DataMapper::Resource
property :id, Integer, :serial => true
property :name, String
Expand Down
2 changes: 1 addition & 1 deletion dm-ar-finders/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def load_driver(name, default_uri)
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name]

FileUtils.touch LOG_PATH
DataMapper::Logger.new(LOG_PATH, 0)
DataMapper::Logger.new(LOG_PATH, :debug)
at_exit { DataMapper.logger.close }
true
rescue LoadError => e
Expand Down
2 changes: 1 addition & 1 deletion dm-ar-finders/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-cli/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
24 changes: 12 additions & 12 deletions dm-constraints/spec/integration/constraints_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
before do
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[adapter]

class Stable
class ::Stable
include DataMapper::Resource
include DataMapper::Constraints

Expand All @@ -21,7 +21,7 @@ class Stable
has n, :cows
end

class Farmer
class ::Farmer
include DataMapper::Resource
include DataMapper::Constraints

Expand All @@ -31,7 +31,7 @@ class Farmer
has n, :cows
end

class Cow
class ::Cow
include DataMapper::Resource
include DataMapper::Constraints

Expand Down Expand Up @@ -94,10 +94,10 @@ class Cow

describe "when :constraint => :protect is given" do
before do
class Farmer
class ::Farmer
has n, :cows, :constraint => :protect
end
class Cow
class ::Cow
belongs_to :farmer
end
end
Expand Down Expand Up @@ -125,10 +125,10 @@ class Cow

describe "when :constraint => :destroy is given" do
before do
class Farmer
class ::Farmer
has n, :cows, :constraint => :destroy
end
class Cow
class ::Cow
belongs_to :farmer
end
DataMapper.auto_migrate!
Expand Down Expand Up @@ -159,10 +159,10 @@ class Cow

describe "when :constraint => :set_nil is given" do
before do
class Farmer
class ::Farmer
has n, :cows, :constraint => :set_nil
end
class Cow
class ::Cow
belongs_to :farmer
end
DataMapper.auto_migrate!
Expand All @@ -187,10 +187,10 @@ class Cow

describe "when :constraint => :skip is given" do
before do
class Farmer
class ::Farmer
has n, :cows, :constraint => :skip
end
class Cow
class ::Cow
belongs_to :farmer
end
DataMapper.auto_migrate!
Expand Down Expand Up @@ -219,7 +219,7 @@ class Cow

it "should raise an error" do
lambda do
class Farmer
class ::Farmer
has n, :cows, :constraint => :chocolate
end
end.should raise_error(ArgumentError)
Expand Down
2 changes: 1 addition & 1 deletion dm-constraints/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-example/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-list/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
6 changes: 3 additions & 3 deletions dm-is-nested_set/spec/integration/nested_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
describe DataMapper::Is::NestedSet do
before do
Object.send(:remove_const, :User) if defined?(User)
class User
class ::User
include DataMapper::Resource

property :id, Serial
Expand All @@ -40,7 +40,7 @@ class User
end

Object.send(:remove_const, :Category) if defined?(Category)
class Category
class ::Category
include DataMapper::Resource

property :id, Integer, :serial => true
Expand All @@ -55,7 +55,7 @@ def pos; [lft,rgt] end # convenience method only for speccing.
end

Object.send(:remove_const, :CustomCategory) if defined?(CustomCategory)
class CustomCategory < Category; end
class ::CustomCategory < Category; end

DataMapper.auto_migrate!

Expand Down
2 changes: 1 addition & 1 deletion dm-is-nested_set/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-remixable/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-searchable/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-state_machine/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-tree/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-versioned/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
2 changes: 1 addition & 1 deletion dm-is-viewable/tasks/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s).map { |f| f.to_s }

begin
gem 'rcov', '~>0.8'
Expand Down
Loading

0 comments on commit 8dcfcee

Please sign in to comment.