File: nova_service_spec.rb

package info (click to toggle)
puppet-module-nova 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,100 kB
  • sloc: ruby: 11,433; python: 38; sh: 10; makefile: 10
file content (29 lines) | stat: -rw-r--r-- 751 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# run with: rspec spec/type/nova_service_spec.rb

require 'spec_helper'


describe Puppet::Type.type(:nova_service) do
  before :each do
    @provider_class = described_class.provide(:simple) do
      mk_resource_methods
      def create; end
      def delete; end
      def exists?; get(:ensure) != :absent; end
      def flush; end
      def self.instances; []; end
    end
  end

  it "should be able to create an instance" do
    expect(described_class.new(:name => 'nova1')).not_to be_nil
  end

  it "should return the given values" do
    c = described_class.new(:name => 'nova1',
                            :service_name => 'nova-scheduler')
    expect(c[:name]).to eq("nova1")
    expect(c[:service_name]).to eq('nova-scheduler')
  end

end