From 330eed801b8bc40812d82df4c0daa7484798ab1e Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Thu, 2 Aug 2012 09:54:48 -0400 Subject: [PATCH] Update dependency on RSpec --- Gemfile.lock | 14 +++++++------- spec/acceptance/build_stubbed_spec.rb | 3 +-- spec/support/matchers/declaration.rb | 14 +++++++++++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e61df14..0b7e655 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,14 +53,14 @@ GEM metaclass (~> 0.0.1) multi_json (1.3.4) rake (0.9.2.2) - rspec (2.9.0) - rspec-core (~> 2.9.0) - rspec-expectations (~> 2.9.0) - rspec-mocks (~> 2.9.0) - rspec-core (2.9.0) - rspec-expectations (2.9.1) + rspec (2.11.0) + rspec-core (~> 2.11.0) + rspec-expectations (~> 2.11.0) + rspec-mocks (~> 2.11.0) + rspec-core (2.11.1) + rspec-expectations (2.11.2) diff-lcs (~> 1.1.3) - rspec-mocks (2.9.0) + rspec-mocks (2.11.1) simplecov (0.6.2) multi_json (~> 1.3) simplecov-html (~> 0.5.3) diff --git a/spec/acceptance/build_stubbed_spec.rb b/spec/acceptance/build_stubbed_spec.rb index 7daa327..5da7351 100644 --- a/spec/acceptance/build_stubbed_spec.rb +++ b/spec/acceptance/build_stubbed_spec.rb @@ -131,7 +131,6 @@ describe "defaulting `created_at`" do end it "doesn't allow setting created_at on an object that doesn't define it" do - expect { build_stubbed(:thing_without_timestamp, :created_at => Time.now) }.to - raise_error(NoMethodError, /created_at=/) + expect { build_stubbed(:thing_without_timestamp, :created_at => Time.now) }.to raise_error(NoMethodError, /created_at=/) end end diff --git a/spec/support/matchers/declaration.rb b/spec/support/matchers/declaration.rb index 2749139..328117a 100644 --- a/spec/support/matchers/declaration.rb +++ b/spec/support/matchers/declaration.rb @@ -49,6 +49,13 @@ module DeclarationMatchers self end + def failure_message + [ + "expected declarations to include declaration of type #{@declaration_type}", + @options ? "with options #{options}" : nil + ].compact.join ' ' + end + private def expected_declaration @@ -56,7 +63,12 @@ module DeclarationMatchers when :static then FactoryGirl::Declaration::Static.new(@name, @value, ignored?) when :dynamic then FactoryGirl::Declaration::Dynamic.new(@name, ignored?, @value) when :implicit then FactoryGirl::Declaration::Implicit.new(@name, @factory, ignored?) - when :association then FactoryGirl::Declaration::Association.new(@name, options) + when :association + if @options + FactoryGirl::Declaration::Association.new(@name, options) + else + FactoryGirl::Declaration::Association.new(@name) + end end end