spec/support/test_client.rb in riak-client-2.4.0 vs spec/support/test_client.rb in riak-client-2.4.1

- old
+ new

@@ -18,11 +18,17 @@ def self.test_client_configuration if defined? $test_client_configuration return $test_client_configuration end - config_path = File.expand_path '../test_client.yml', __FILE__ - config = YAML.load_file(config_path).symbolize_keys + begin + config_path = File.expand_path '../test_client.yml', __FILE__ + config = YAML.load_file(config_path).symbolize_keys + rescue Errno::ENOENT => ex + $stderr.puts("WARNING: could not find file: #{config_path}, exception: #{ex}") + config = {} + config[:pb_port] = 10017 + end if config[:nodes] new_nodes = config[:nodes].map(&:symbolize_keys) config[:nodes] = new_nodes end