sdot257
sdot257

Reputation: 10366

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' }

Upvotes: 0

Views: 285

Answers (2)

slashpai
slashpai

Reputation: 1169

Inspec supports both styles .

it { should be_owned_by 'cool_user' }
it { should be_grouped_into 'cool_group' }

Though this style looks more like serverspec way of writing it :)

Upvotes: 0

coderanger
coderanger

Reputation: 54211

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.

Upvotes: 2

Related Questions