File: pool_tests.rb

package info (click to toggle)
ruby-fog-libvirt 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 512 kB
  • sloc: ruby: 2,595; makefile: 4
file content (27 lines) | stat: -rw-r--r-- 944 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
Shindo.tests('Fog::Compute[:libvirt] | interface model', ['libvirt']) do

  pools = Fog::Compute[:libvirt].pools
  pool = pools.last

  tests('The interface model should') do
    tests('have the action') do
      test('reload') { pool.respond_to? 'reload' }
    end
    tests('have attributes') do
      model_attribute_hash = pool.attributes
      attributes = [ :uuid, :name, :persistent, :active, :autostart, :allocation, :capacity, :num_of_volumes, :state]
      tests("The interface model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { pool.respond_to? attribute }
        end
      end
      tests("The attributes hash should have key") do
        attributes.each do |attribute|
          test("#{attribute}") { model_attribute_hash.key? attribute }
        end
      end
    end
    test('be a kind of Fog::Libvirt::Compute::Pool') { pool.kind_of? Fog::Libvirt::Compute::Pool }
  end

end