Builder#use returns self, for chaining

This commit is contained in:
Mitchell Hashimoto 2010-07-07 21:00:54 -07:00
parent f45989d1d5
commit 086ca5a97e
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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