0

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' }
sdot257
  • 10,046
  • 26
  • 88
  • 122

2 Answers2

2

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.

coderanger
  • 52,400
  • 4
  • 52
  • 75
0

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 :)

slashpai
  • 1,141
  • 7
  • 12