Sha256: 89434a8a306f4b9fdd01d377936dbccbced45ca919df916889c54c463e369287
Contents?: true
Size: 1.02 KB
Versions: 9
Compression:
Stored size: 1.02 KB
Contents
require "spec_helper" module Test module BuilderDependency class ClassDelegate def call( hunt, *args, &block ) Test end end module ModDelegate module_function def call( hunt, *args, &block ) Test end end end end describe Scorpion::Dependency::BuilderDependency do let( :scorpion ) { double } let( :hunt ) { Scorpion::Hunt.new( scorpion, String, nil ) } it "supports class hunting delegates" do dependency = Scorpion::Dependency::BuilderDependency.new( String, Test::BuilderDependency::ClassDelegate.new ) expect( dependency.fetch( hunt ) ).to be Test end it "supports module hunting delegates" do dependency = Scorpion::Dependency::BuilderDependency.new( String, Test::BuilderDependency::ModDelegate ) expect( dependency.fetch( hunt ) ).to be Test end it "supports block hunting delegates" do dependency = Scorpion::Dependency::BuilderDependency.new( String ) do Test end expect( dependency.fetch( hunt ) ).to be Test end end
Version data entries
9 entries across 9 versions & 1 rubygems