Builder#use returns self, for chaining
This commit is contained in:
parent
f45989d1d5
commit
086ca5a97e
|
@ -52,6 +52,8 @@ module Vagrant
|
|||
else
|
||||
self.stack << [middleware, args, block]
|
||||
end
|
||||
|
||||
self
|
||||
end
|
||||
|
||||
# Inserts a middleware at the given index or directly before the
|
||||
|
|
|
@ -28,6 +28,10 @@ class ActionBuilderTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
context "adding to the stack" do
|
||||
should "return self" do
|
||||
assert @instance.equal?(@instance.use(1))
|
||||
end
|
||||
|
||||
should "add to the end" do
|
||||
@instance.use 1
|
||||
@instance.use 2
|
||||
|
|
Loading…
Reference in New Issue