Sha256: 3fadbdba89e13e467be97a278e95b5d2258852920fb2759789b6edfc8930055c

Contents?: true

Size: 1.41 KB

Versions: 10

Compression:

Stored size: 1.41 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "Script" do
  it "should have inflate as a class method" do
    Script.respond_to?(:inflate).should == true
  end
  it "should have inflate_file as an instance method" do
    Script.respond_to?(:inflate_file).should == true
  end
  it "should have inflate as an instance method" do
    Script.new.respond_to?(:inflate).should == true
  end
  
  describe "with a script" do
    before(:each) do
      @script = 'script'
      @filename = 'filename'

      @pool = Script.new
      Script.stub!(:new).and_return(@pool)
      @pool.stub!(:inflate).and_return true
    end
    
    it "should create a new Script when calling on the class method" do
      Script.should_receive(:new).and_return @pool      
    end    
    it "should instance eval the script" do
      @pool.should_receive(:instance_eval).with(@script, @filename).and_return true
    end
    it "should call inflate on itself" do
      @pool.should_receive(:inflate).and_return true
    end
    after do
      Script.inflate(@script, @filename)
    end
    describe "save!" do
      before(:each) do
        pool :appdotcom do
          keypair "snoodle"
          cloud :app do
            has_file :name => "/etc/httpd/httpd.conf"
          end
        end
        @saved = Script.save!(false)
      end
      it "should save the keypair" do
        @saved.should =~ /keypair "snoodle"/
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
auser-poolparty-0.2.15 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.16 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.3 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.4 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.5 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.6 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.8 spec/poolparty/pool/script_spec.rb
auser-poolparty-0.2.9 spec/poolparty/pool/script_spec.rb
poolparty-0.2.6 spec/poolparty/pool/script_spec.rb
poolparty-0.2.18 spec/poolparty/pool/script_spec.rb