test/test_helper.rb in inch-0.5.0.rc3 vs test/test_helper.rb in inch-0.5.0.rc4
- old
+ new
@@ -1,14 +1,14 @@
-require 'simplecov'
+require "simplecov"
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
-require 'minitest/autorun'
-require 'bundler'
+require "minitest/autorun"
+require "bundler"
Bundler.require
-require 'inch'
-require 'inch/cli'
+require "inch"
+require "inch/cli"
def assert_roles(object, expected, unexpected)
roles = object.roles.map(&:class)
unexpected.each do |role|
refute roles.include?(role), "Should not assign #{role}"
@@ -26,30 +26,30 @@
object.roles.select do |r|
r.class == role_class && (object_name.nil? || r.object.name == object_name)
end
end
-def fixture_path(name)
- File.join(File.dirname(__FILE__), "fixtures", name.to_s)
+def fixture_path(language, name)
+ File.join(File.dirname(__FILE__), "fixtures", language.to_s, name.to_s)
end
module Inch
module Test
class << self
attr_accessor :object_providers
- def codebase(name)
- Inch::Codebase::Proxy.new object_provider(name)
+ def codebase(language, name)
+ Inch::Codebase::Proxy.new language, object_provider(language, name)
end
- def object_provider(name)
+ def object_provider(language, name)
self.object_providers ||= {}
- self.object_providers[name] ||= ::Inch::CodeObject::Provider.parse(fixture_path(name))
+ self.object_providers[name] ||= ::Inch::CodeObject::Provider.parse(fixture_path(language, name))
end
end
end
end
def test_codebase(name)
- codebase = Inch::Test.codebase(name)
+ codebase = Inch::Test.codebase(:ruby, name)
codebase
end