Permalink
Browse files

The configuration needs to pass itself to new endpoints as the config.

  • Loading branch information...
1 parent a547628 commit c8ce86531d6cf9c7202e9beeedb51a0811ab7ee5 @myronmarston myronmarston committed Apr 27, 2013
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/interpol/configuration.rb
  2. +7 −0 spec/unit/interpol/configuration_spec.rb
@@ -50,7 +50,7 @@ def initialize
def endpoint_definition_files=(files)
self.endpoints = files.map do |file|
- Endpoint.new(deserialized_hash_from file)
+ Endpoint.new(deserialized_hash_from(file), self)
end
@endpoint_definition_files = files
end
@@ -150,6 +150,13 @@ def find_with_status_code(status_code, options)
expect(config.endpoints.map(&:name)).to match_array %w[ project_list task_list ]
end
+ it 'passes itself to the endpoints as the configuration' do
+ write_file "#{dir}/e1.yml", endpoint_definition_yml
+ config.endpoint_definition_files = Dir["#{dir}/*.yml"]
+ endpoint_config = config.endpoints.first.configuration
+ expect(endpoint_config).to be(config)
+ end
+
context "when YAML merge keys are used" do
let_without_indentation(:types) do <<-EOF
---

0 comments on commit c8ce865

Please sign in to comment.