Skip to content

Commit

Permalink
Update dependency on RSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Aug 2, 2012
1 parent 4311689 commit 330eed8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions spec/acceptance/build_stubbed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
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
14 changes: 13 additions & 1 deletion spec/support/matchers/declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,26 @@ def with_options(options)
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
case @declaration_type
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

Expand Down

0 comments on commit 330eed8

Please sign in to comment.