Sha256: 568ef2cae002bb4e675c55d5e52966e7f3a2524a5544812868183d36a55a2534

Contents?: true

Size: 951 Bytes

Versions: 28

Compression:

Stored size: 951 Bytes

Contents

#!/usr/bin/env rspec

require 'spec_helper'

require 'mcollective/data/collective_data'

module MCollective
  module Data
    describe Collective_data do
      describe "#query_data" do
        before :each do
          @ddl = mock('DDL')
          @ddl.stubs(:dataquery_interface).returns({:output => {}})
          @ddl.stubs(:meta).returns({:timeout => 1})
          DDL.stubs(:new).returns(@ddl)
          @plugin = Collective_data.new

          Config.instance.stubs(:collectives).returns([ "collective_a", "collective_b" ])
        end

        it 'should return true if you are a member of the named collective' do
          @plugin.query_data("collective_a")
          @plugin.result[:member].should == true
        end

        it 'should return false if you are a member of the named collective' do
          @plugin.query_data("no_such_collective")
          @plugin.result[:member].should == false
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
mcollective-client-2.9.1 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.9.0 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.8.9 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.8.4 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.8.3 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.8.2 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.8.1 spec/unit/mcollective/data/collective_data_spec.rb
mcollective-client-2.8.0 spec/unit/mcollective/data/collective_data_spec.rb