Search code examples
chef-infrainspec

Inspec: checking for user and group


What's the difference between these two?

it { should be_owned_by 'cool_user' }
vs
its('owner') { should eq 'cool_user' }

it { should be_grouped_into 'cool_group' }
vs
its('group') { should eq 'cool_group' }

Solution

  • No difference, just two ways to write it. https://github.com/chef/train/blob/master/lib/train/extras/file_common.rb#L107 and similar for the other.