riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
619 stars 152 forks source link

Ripple::TestServer clobbers custom add_paths from config #256

Closed outoftime closed 12 years ago

outoftime commented 12 years ago

Given the following config:

test:
  env:
    riak_kv:
      add_paths:
        - <%= Rails.root.join('app/mapreduce/erlang') %>

We get the following:

ruby-1.9.2-p290-patched :004 >   Ripple::TestServer.instance.env[:riak_kv][:add_paths]
 => [] 

ruby-1.9.2-p290-patched :005 > Ripple.config[:env][:riak_kv][:add_paths]
 => ["/home/mat/Projects/brewster/app/mapreduce/erlang", "/home/mat/.rvm/gems/ruby-1.9.2-p290-patched/gems/riak-client-1.0.0.snapshot.60d08fe/erl_src"]

The only way I've found to get this to work is to add the following to my spec_helper before Ripple::TestServer.setup:

(Ripple::TestServer.instance.env[:riak_kv][:add_paths] ||= []) << Rails.root.join('app/mapreduce/erlang').to_s
seancribbs commented 12 years ago

@outoftime I've looked into this, and can confirm that the Ripple::TestServer does not clobber :add_paths (see https://github.com/basho/riak-ruby-client/blob/master/lib/riak/test_server.rb#L19); however the problem is likely that the string keys are not turning into symbolized keys when loading the config file. There will be a fix for this shortly.