Module: ChefSpec::API::DeprecatedMatchers

Defined in:
lib/chefspec/deprecations.rb

Overview

TODO:

Remove in v4.0.0

Instance Method Summary collapse

Instance Method Details

#be_owned_by(user, group) ⇒ Object

Raises:

  • (ChefSpec::NoConversionError)


57
58
59
60
61
62
63
64
65
# File 'lib/chefspec/deprecations.rb', line 57

def be_owned_by(user, group)
  deprecated "The `be_owned_by` matcher is deprecated. Please use:" \
    "\n\n" \
    "  expect(resource.owner).to eq('#{user}')\n" \
    "  expect(resource.group).to eq('#{group}')" \
    "\n\n" \
    "instead"
  raise ChefSpec::NoConversionError.new('be_owned_by')
end

#create_file_with_content(path, content) ⇒ Object



67
68
69
70
71
72
# File 'lib/chefspec/deprecations.rb', line 67

def create_file_with_content(path, content)
  deprecated "The `create_file_with_content` matcher is deprecated." \
    " Please use `render_file(#{path.inspect})" \
    ".with_content(#{content.inspect})` instead."
  ChefSpec::Matchers::RenderFileMatcher.new(path).with_content(content)
end

#execute_command(command) ⇒ Object



120
121
122
123
124
# File 'lib/chefspec/deprecations.rb', line 120

def execute_command(command)
  deprecated "The `execute_command` matcher is deprecated. Please" \
    " use `run_execute(#{command.inspect})` instead."
  ChefSpec::Matchers::ResourceMatcher.new(:execute, :run, command)
end

#execute_ruby_block(name) ⇒ Object



114
115
116
117
118
# File 'lib/chefspec/deprecations.rb', line 114

def execute_ruby_block(name)
  deprecated "The `execute_ruby_block` matcher is deprecated. Please" \
    " use `run_ruby_block(#{name.inspect})` instead."
  ChefSpec::Matchers::ResourceMatcher.new(:ruby_block, :run, name)
end

#log(message) ⇒ Object



94
95
96
97
98
# File 'lib/chefspec/deprecations.rb', line 94

def log(message)
  deprecated "The `log` matcher is deprcated. Please use" \
    " `write_log(#{message.inspect}) instead."
  ChefSpec::Matchers::ResourceMatcher.new(:log, :write, message)
end

#set_service_to_not_start_on_boot(service) ⇒ Object

Raises:

  • (ChefSpec::NoConversionError)


107
108
109
110
111
112
# File 'lib/chefspec/deprecations.rb', line 107

def set_service_to_not_start_on_boot(service)
  deprecated "The `set_service_to_not_start_on_boot` matcher is" \
    " deprecated. Please use `enable_service(#{service.inspect})`" \
    " with a negating argument instead."
  raise ChefSpec::NoConversionError.new('set_service_to_start_on_boot')
end

#set_service_to_start_on_boot(service) ⇒ Object



100
101
102
103
104
105
# File 'lib/chefspec/deprecations.rb', line 100

def set_service_to_start_on_boot(service)
  deprecated "The `set_service_to_start_on_boot` matcher is" \
    " deprecated. Please use `enable_service(#{service.inspect})`" \
    " instead."
  ChefSpec::Matchers::ResourceMatcher.new(:service, :enable, service)
end