Add test for receiving dependencies
This commit is contained in:
10
test/dummy/app/helpers/LogicUnitReceiver.rb
Normal file
10
test/dummy/app/helpers/LogicUnitReceiver.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class LogicUnitReceiver
|
||||
include Laradi::Mixin
|
||||
|
||||
def get_unit
|
||||
dependencies :logic_unit
|
||||
|
||||
logic_unit
|
||||
end
|
||||
|
||||
end
|
||||
@@ -10,4 +10,11 @@ class LaradiTest < ActiveSupport::TestCase
|
||||
|
||||
assert lu.execute === "It Works"
|
||||
end
|
||||
|
||||
test "It can inject dependencies" do
|
||||
lur = LogicUnitReceiver.new
|
||||
|
||||
assert_not_nil lur.get_unit
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user