From bc78a21211401f8a45c81512e0fd6f66164f1129 Mon Sep 17 00:00:00 2001 From: "Josep M. Blanquer" Date: Fri, 19 Aug 2016 11:18:16 -0700 Subject: [PATCH] Upgrade to attributor 5.1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the spec based on the semantics of having examples in descriptions based on ‘shallow’-ness. Changed the spec as a shallow description of a collection should still have the example (as it’s a leaf). Signed-off-by: Josep M. Blanquer --- praxis-blueprints.gemspec | 2 +- spec/praxis-blueprints/blueprint_spec.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/praxis-blueprints.gemspec b/praxis-blueprints.gemspec index 590a5e8..64072bf 100644 --- a/praxis-blueprints.gemspec +++ b/praxis-blueprints.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_runtime_dependency('randexp', ['~> 0']) - spec.add_runtime_dependency('attributor', ['>= 5.0.2']) + spec.add_runtime_dependency('attributor', ['>= 5.1']) spec.add_runtime_dependency('activesupport', ['>= 3']) spec.add_development_dependency 'bundler', '~> 1.6' diff --git a/spec/praxis-blueprints/blueprint_spec.rb b/spec/praxis-blueprints/blueprint_spec.rb index 9b96301..ed683f2 100644 --- a/spec/praxis-blueprints/blueprint_spec.rb +++ b/spec/praxis-blueprints/blueprint_spec.rb @@ -226,11 +226,14 @@ end it 'outputs examples for leaf values using the provided example' do + output[:attributes][:name][:example].should eq example.name output[:attributes][:age][:example].should eq example.age + output[:attributes][:aliases].should have_key(:example) + output[:attributes][:aliases][:example].should eq example.aliases.dump + output[:attributes][:full_name].should_not have_key(:example) - output[:attributes][:aliases].should_not have_key(:example) parents_attributes = output[:attributes][:parents][:type][:attributes] parents_attributes[:father][:example].should eq example.parents.father