diff options
author | Rick Bradley <rick@rickbradley.com> | 2008-03-12 23:26:05 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-11 13:10:34 -0500 |
commit | a1c45790f6cac265a7bac7d63bfb8a3204ed228f (patch) | |
tree | 808d482944db34402ede03b32914de7e975731bf /spec/integration | |
parent | 7d51146e98e4135d933be5b2b227a0ca92f06ef2 (diff) | |
download | puppet-a1c45790f6cac265a7bac7d63bfb8a3204ed228f.tar.gz puppet-a1c45790f6cac265a7bac7d63bfb8a3204ed228f.tar.xz puppet-a1c45790f6cac265a7bac7d63bfb8a3204ed228f.zip |
a trivial integration test to test whether the RESTful indirection terminus has a remote shot at working; will need to be upgraded to actually be useful
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/indirector/rest.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/integration/indirector/rest.rb b/spec/integration/indirector/rest.rb new file mode 100644 index 000000000..a8c6f5609 --- /dev/null +++ b/spec/integration/indirector/rest.rb @@ -0,0 +1,35 @@ +require File.dirname(__FILE__) + '/../../spec_helper' +require 'puppet/network/server' +require 'puppet/indirector' +require 'puppet/indirector/rest' + +class Puppet::TestIndirectedFoo + extend Puppet::Indirector + indirects :test_indirected_foo, :terminus_setting => :test_indirected_foo_terminus + + def initialize(foo) + STDERR.puts "foo!" + end +end + +class Puppet::TestIndirectedFoo::Rest < Puppet::Indirector::REST +end + +describe Puppet::Indirector::REST do + before :each do + Puppet::Indirector::Terminus.stubs(:terminus_class).returns(Puppet::TestIndirectedFoo::Rest) + Puppet::TestIndirectedFoo.terminus_class = :rest + Puppet[:servertype] = 'mongrel' + @params = { :address => "127.0.0.1", :port => 34346, :handlers => [ :test_indirected_foo ] } + @server = Puppet::Network::Server.new(@params) + @server.listen + end + + it "should not fail to find an instance over REST" do + lambda { Puppet::TestIndirectedFoo.find('bar') }.should_not raise_error + end + + after :each do + @server.unlisten + end +end
\ No newline at end of file |