Actually, I've discovered that none of my specs work.
Here is my spec_helper.rb:
# This file is copied to spec/ when you run 'rails generate
rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the
appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
# Remove this line if you're not using ActiveRecord or ActiveRecord
fixtures
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each
of your
# examples within a transaction, remove the following line or assign
false
# instead of true.
#config.use_transactional_fixtures = true
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future
versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
config.before(:suite) { DataMapper.auto_migrate! }
end
And here is my Gemfile:
gem 'rails', '3.1.0'
#Database
gem 'pg'
gem 'dm-postgres-adapter'
gem 'data_mapper'
gem 'dm-rails'
#Web
gem 'jquery-rails'
gem 'thin'
# Gems used only for assets and not required in production
environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
group :development, :test do
gem 'faker'
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'rspec'
gem "rspec-rails"
end
group :test do
# Pretty printed test output
gem 'turn', :require => false
gem 'factory_girl_rails'
end
group :development do
gem 'dm-sqlite-adapter'
gem 'gibberish'
end
Thanks.
On Dec 24, 11:41 am, Neil Chaudhuri <[email protected]> wrote:
> I had an existing (but fairly new) Rails/DataMapper application whose
> controller specs were working, but I came to realize I needed dm-rails
> to get Rails to disregard ActiveRecord and favor DataMapper. So I
> installed dm-rails, but now my controller specs fail for a reason that
> is unclear to me:
>
> /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:196:in `merge!': can't convert String into Hash
> (TypeError)
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:196:in `block in visit_Psych_Nodes_Mapping'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:190:in `each'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:190:in `each_slice'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:190:in `visit_Psych_Nodes_Mapping'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/visitor.rb:7:in `accept'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:16:in `accept'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:205:in `block in visit_Psych_Nodes_Mapping'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:190:in `each'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:190:in `each_slice'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:190:in `visit_Psych_Nodes_Mapping'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/visitor.rb:7:in `accept'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> visitors/to_ruby.rb:16:in `accept'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/
> nodes/node.rb:25:in `to_ruby'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/
> psych.rb:107:in `load'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/application/configuration.rb:100:in
> `database_configuration'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/dm-
> rails-1.2.0/lib/dm-rails/railtie.rb:39:in `configure_data_mapper'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/dm-
> rails-1.2.0/lib/dm-rails/railtie.rb:60:in `block in <class:Railtie>'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/initializable.rb:25:in `run'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/initializable.rb:50:in `block in
> run_initializers'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/initializable.rb:49:in `each'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/
> railties-3.1.0/lib/rails/railtie/configurable.rb:30:in
> `method_missing'
> from /Users/Username/Vidya/applications/rails/myapp/config/
> environment.rb:5:in `<top (required)>'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/
> 1.9.1/rubygems/custom_require.rb:36:in `require'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/
> 1.9.1/rubygems/custom_require.rb:36:in `require'
> from /Users/Username/Vidya/applications/rails/myapp/spec/
> spec_helper.rb:3:in `<top (required)>'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/
> 1.9.1/rubygems/custom_require.rb:36:in `require'
> from /Users/Username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/
> 1.9.1/rubygems/custom_require.rb:36:in `require'
> from /Users/Username/Vidya/applications/rails/myapp/spec/controllers/
> clients_controller_spec.rb:1:in `<top (required)>'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in
> load_spec_files'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
> from /Users/Username/.rvm/gems/ruby-1.9.2-p290@global/gems/rspec-
> core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
>
> This is a fairly critical issue for me, so any insight is appreciated.
>
> Thanks.
--
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en.