Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

undefined method 'hkeys' for "localhost:5959":String #8

Closed
charleschen opened this issue Nov 18, 2011 · 1 comment
Closed

undefined method 'hkeys' for "localhost:5959":String #8

charleschen opened this issue Nov 18, 2011 · 1 comment

Comments

@charleschen
Copy link

One of spec test is failing when deleting data that has "include Likeable":

  1. Product on destroy should destroy reverse association
    Failure/Error: relationship.destroy
    NoMethodError:
    undefined method `hkeys' for "localhost:6969":String
it 'should destroy reverse association' do
  @product.reverse_stock_strains.create(:club_id => Factory(:club).id)
  lambda {@product.destroy}.should change(Stock,:count).from(1).to(0)
end

Stock is the model that is including likeable. Since Stock is dependent on Product, it destroy Stock when Product is destroyed. That's when it throws the error.

localhost:6969 is where my redis test server:

RSpec.configure do |config|
REDIS_PID = "#{Rails.root}/tmp/pids/redis-test.pid"
REDIS_CACHE_PATH = "#{Rails.root}/tmp/cache/"

config.before(:suite) do
redis_options = {
"daemonize" => 'yes',
"pidfile" => REDIS_PID,
"port" => 6969,
"timeout" => 300,
"save 900" => 1,
"save 300" => 1,
"save 60" => 10000,
"dbfilename" => "dump.rdb",
"dir" => REDIS_CACHE_PATH,
"loglevel" => "debug",
"logfile" => "stdout",
"databases" => 16
}.map { |k, v| "#{k} #{v}" }.join('\n')
echo '#{redis_options}' | redis-server -
end
config.after(:suite) do
%x{
cat #{REDIS_PID} | xargs kill -QUIT
rm -f #{REDIS_CACHE_PATH}dump.rdb
}
end
end

is anyone else getting this error?

@charleschen
Copy link
Author

okay never mind. made a mistake in the initialization of the redis server

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant