~ubuntu-branches/ubuntu/raring/facter/raring

« back to all changes in this revision

Viewing changes to spec/unit/util/wmi_spec.rb

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2011-10-18 10:32:42 UTC
  • mfrom: (1.1.10 upstream) (3.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20111018103242-vvgvfa9pf057xnmj
Tags: 1.6.1-1ubuntu1
* Merge from Debian unstable (LP: #877621). Remaining changes:
  - debian/rules: use what we had in natty; we dont want ruby-pkg-tools
    in main. (LP: #408402)
* debian/control: Continue using ruby + libopenssl-ruby as Build-Depends
  even tho Debian has moved to gem2deb (not in main). Move ruby-json to
  Suggests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env ruby
 
2
 
 
3
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
4
 
 
5
require 'facter/util/wmi'
 
6
 
 
7
describe Facter::Util::WMI do
 
8
  let(:connection) { stub 'connection' }
 
9
 
 
10
  it "should default to localhost" do
 
11
    Facter::Util::WMI.wmi_resource_uri.should == "winmgmts:{impersonationLevel=impersonate}!//./root/cimv2"
 
12
  end
 
13
 
 
14
  it "should execute the query on the connection" do
 
15
    Facter::Util::WMI.stubs(:connect).returns(connection)
 
16
    connection.stubs(:execquery).with("select * from Win32_OperatingSystem")
 
17
 
 
18
    Facter::Util::WMI.execquery("select * from Win32_OperatingSystem")
 
19
  end
 
20
end