Module: ChefSpec::API::Link

Defined in:
lib/chefspec/api/link.rb

Instance Method Summary collapse

Instance Method Details

Assert that a symlink links to a specific path. This is really syntactic sugar for the following:

expect(chef_run).to create_link('/tmp/thing').with(to: '/tmp/other_thing')

Examples:

Using link_to with a String path

link = chef_run.link('/tmp/thing')
expect(link).to link_to('/tmp/other_thing')

Using link_to with a regular expression

expect(link).to link_to(/\/tmp/(.+)/)

Parameters:

  • path (String, Regex)

    the path to link to

Returns:



22
23
24
# File 'lib/chefspec/api/link.rb', line 22

def link_to(path)
  ChefSpec::Matchers::LinkToMatcher.new(path)
end