Sha256: b04360465affbb914ff540074fb2d2d4a7ee03fce78233b3f847dfb39ba95548

Contents?: true

Size: 1.09 KB

Versions: 47

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

module Beaker
  describe Windows::Group do
    class WindowsGroupTest
      include Windows::Group
    end

    let(:instance) { WindowsGroupTest.new }
    let(:result) { double(:result, :stdout => group_list_output) }
    let(:group_list_output) do <<-EOS


Name=Foo


Name=Bar6


      EOS
    end

    def add_group(group_name)
      group_list_output << <<-EOS
Name=#{group_name}


      EOS
    end

    before(:each) do
      instance.should_receive(:execute).with(/wmic group where/).and_yield(result)
    end

    it "gets a group_list" do
      expect(instance.group_list).to eql(["Foo", "Bar6"])
    end

    it "gets groups with spaces" do
      add_group("With Spaces")
      expect(instance.group_list).to eql(["Foo", "Bar6", "With Spaces"])
    end


    it "gets groups with dashes" do
      add_group("With-Dashes")
      expect(instance.group_list).to eql(["Foo", "Bar6", "With-Dashes"])
    end

    it "gets groups with underscores" do
      add_group("With_Underscores")
      expect(instance.group_list).to eql(["Foo", "Bar6", "With_Underscores"])
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
beaker-1.12.2 spec/beaker/host/windows/group_spec.rb
beaker-1.12.1 spec/beaker/host/windows/group_spec.rb
beaker-1.12.0 spec/beaker/host/windows/group_spec.rb
beaker-1.11.2 spec/beaker/host/windows/group_spec.rb
beaker-1.11.1 spec/beaker/host/windows/group_spec.rb
beaker-1.11.0 spec/beaker/host/windows/group_spec.rb
beaker-1.10.0 spec/beaker/host/windows/group_spec.rb
beaker-1.9.1 spec/beaker/host/windows/group_spec.rb
beaker-1.9.0 spec/beaker/host/windows/group_spec.rb
beaker-1.8.2 spec/beaker/host/windows/group_spec.rb
beaker-1.8.1 spec/beaker/host/windows/group_spec.rb
beaker-1.8.0 spec/beaker/host/windows/group_spec.rb
beaker-1.7.0 spec/beaker/host/windows/group_spec.rb
beaker-1.6.2 spec/beaker/host/windows/group_spec.rb
beaker-1.6.1 spec/beaker/host/windows/group_spec.rb
beaker-1.6.0 spec/beaker/host/windows/group_spec.rb
beaker-1.5.0 spec/beaker/host/windows/group_spec.rb
beaker-1.4.1 spec/beaker/host/windows/group_spec.rb
beaker-1.4.0 spec/beaker/host/windows/group_spec.rb
beaker-1.3.2 spec/beaker/host/windows/group_spec.rb