Sha256: cbb1ec19600ac9566ecbbc330bddcc669c4868b0e7c4fd967ac37ec45a33ec7a
Contents?: true
Size: 920 Bytes
Versions: 5
Compression:
Stored size: 920 Bytes
Contents
require_relative '../spec_helper' describe Dependor::ClassNameResolver do class FooBarBaz end class FooBarBaz2 end module Foo class FooBarBaz end end module Bar class FooBarBaz end end it "returns nil when the class could not be found" do resolver = Dependor::ClassNameResolver.new([]) resolver.for_name(:something).should be_nil end it "uses global scope with no search_modules" do resolver = Dependor::ClassNameResolver.new([]) resolver.for_name(:foo_bar_baz).should == FooBarBaz end it "searches modules in order specified" do resolver = Dependor::ClassNameResolver.new([Foo, Bar]) resolver.for_name(:foo_bar_baz).should == Foo::FooBarBaz end it "searches in order specified, with the global scope last" do resolver = Dependor::ClassNameResolver.new([Foo, Bar]) resolver.for_name(:foo_bar_baz_2).should == FooBarBaz2 end end
Version data entries
5 entries across 5 versions & 1 rubygems