Permalink
Browse files

Bump major version of MiniTest with mock fixes.

  • Loading branch information...
1 parent 963fb83 commit 8485470f76b30f312b364dfed13fa152d1eef268 @acrmp acrmp committed Aug 8, 2012
Showing with 13 additions and 4 deletions.
  1. +1 −1 Gemfile
  2. +12 −3 spec/foodcritic/api_spec.rb
View
@@ -5,7 +5,7 @@ gem 'foodcritic', :path => '.'
group :test do
gem 'aruba', '~> 0.4.11'
gem 'cucumber', '~> 1.2.1'
- gem 'minitest', '~> 2.11.2'
+ gem 'minitest', '~> 3.3.0'
gem 'simplecov', '~> 0.6.4'
end
@@ -26,7 +26,9 @@ def parse_ast(str)
end.must_raise(ArgumentError)
end
it "does not raise if the specified node type is valid" do
- ast.expect :xpath, [], [String, FoodCritic::Api::AttFilter]
+ ast.expect :xpath, [], [/field/, FoodCritic::Api::AttFilter]
+ ast.expect :xpath, [], [/symbol/, FoodCritic::Api::AttFilter]
+ ast.expect :xpath, [], [/tstring_content/, FoodCritic::Api::AttFilter]
[:vivified, :symbol, :string].each do |access_type|
api.attribute_access(ast, :type => access_type)
end
@@ -35,6 +37,7 @@ def parse_ast(str)
call = MiniTest::Mock.new
call.expect :xpath, [], [/args_add_block/]
call.expect :xpath, ["node", "bar"], [/ident/]
+ call.expect :xpath, ["foo"], [/@value/]
ast.expect :xpath, [call], [String, FoodCritic::Api::AttFilter]
api.attribute_access(ast, :type => :vivified).must_equal([call])
ast.verify
@@ -95,7 +98,10 @@ def parse_ast(str)
lambda{api.declared_dependencies(nil)}.must_raise ArgumentError
end
it "returns an empty if there are no declared dependencies" do
- ast = MiniTest::Mock.new.expect :xpath, [], [String]
+ ast = MiniTest::Mock.new
+ 3.times do
+ ast.expect :xpath, [], [String]
+ end
api.declared_dependencies(ast).must_be_empty
end
it "includes only cookbook names in the returned array" do
@@ -1254,7 +1260,10 @@ def str_to_atts(str)
lambda{api.resource_attributes(nil)}.must_raise ArgumentError
end
it "returns an empty if the resource has no attributes" do
- resource = MiniTest::Mock.new.expect :xpath, [], [String]
+ resource = MiniTest::Mock.new
+ 3.times do
+ resource.expect :xpath, [], [String]
+ end
api.resource_attributes(resource).must_equal({})
end
it "returns a string value for a literal string" do

0 comments on commit 8485470

Please sign in to comment.