Sha256: 3743fe04b65b8f2a6a5d5cc29873e26f5424a3823ba56e4579859dfb1eddeb39

Contents?: true

Size: 1.1 KB

Versions: 158

Compression:

Stored size: 1.1 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
      expect( instance ).to 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

158 entries across 158 versions & 1 rubygems

Version Path
beaker-4.25.0 spec/beaker/host/windows/group_spec.rb
beaker-4.24.0 spec/beaker/host/windows/group_spec.rb
beaker-4.23.2 spec/beaker/host/windows/group_spec.rb
beaker-4.23.1 spec/beaker/host/windows/group_spec.rb
beaker-4.23.0 spec/beaker/host/windows/group_spec.rb
beaker-4.22.1 spec/beaker/host/windows/group_spec.rb
beaker-4.22.0 spec/beaker/host/windows/group_spec.rb
beaker-4.21.0 spec/beaker/host/windows/group_spec.rb
beaker-4.20.0 spec/beaker/host/windows/group_spec.rb
beaker-4.19.0 spec/beaker/host/windows/group_spec.rb
beaker-4.18.0 spec/beaker/host/windows/group_spec.rb
beaker-4.17.0 spec/beaker/host/windows/group_spec.rb
beaker-4.16.0 spec/beaker/host/windows/group_spec.rb
beaker-4.15.0 spec/beaker/host/windows/group_spec.rb
beaker-4.14.1 spec/beaker/host/windows/group_spec.rb
beaker-4.14.0 spec/beaker/host/windows/group_spec.rb
beaker-4.13.1 spec/beaker/host/windows/group_spec.rb
beaker-4.13.0 spec/beaker/host/windows/group_spec.rb
beaker-4.12.0 spec/beaker/host/windows/group_spec.rb
beaker-4.11.1 spec/beaker/host/windows/group_spec.rb