class ChefSpec::Stubs::DataBagStub

Attributes

bag[R]
block[R]

Public Class Methods

new(bag, &block) click to toggle source
# File lib/chefspec/stubs/data_bag_stub.rb, line 9
def initialize(bag, &block)
  @bag   = bag.to_s
  @block = block
end

Public Instance Methods

signature() click to toggle source
# File lib/chefspec/stubs/data_bag_stub.rb, line 14
def signature
  if @block
    "stub_data_bag(#{@bag.inspect}) { # Ruby code }"
  else
    "stub_data_bag(#{@bag.inspect}).and_return(#{@value})"
  end
end