Fill in the provider API a bit more to what it is.

This commit is contained in:
Mitchell Hashimoto 2012-07-16 15:24:51 -07:00
parent aef2c5f48e
commit 912998ef31
2 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,13 @@ module Vagrant
# is responsible for creating compute resources to match the needs # is responsible for creating compute resources to match the needs
# of a Vagrant-configured system. # of a Vagrant-configured system.
class Provider class Provider
# Initialize the provider to represent the given machine.
#
# @param [Vagrant::Machine] machine The machine that this provider
# is responsible for.
def initialize(machine)
end
# This should return an action callable for the given name. # This should return an action callable for the given name.
# #
# @param [Symbol] name Name of the action. # @param [Symbol] name Name of the action.
@ -13,6 +20,14 @@ module Vagrant
def action(name) def action(name)
nil nil
end end
# This should return the state of the machine within this provider.
# The state can be any symbol.
#
# @return [Symbol]
def state
nil
end
end end
end end
end end

View File

@ -1,7 +1,8 @@
require File.expand_path("../../../../base", __FILE__) require File.expand_path("../../../../base", __FILE__)
describe Vagrant::Plugin::V1::Provider do describe Vagrant::Plugin::V1::Provider do
let(:instance) { described_class.new } let(:machine) { Object.new }
let(:instance) { described_class.new(machine) }
it "should return nil by default for actions" do it "should return nil by default for actions" do
instance.action(:whatever).should be_nil instance.action(:whatever).should be_nil