glidenote/serverspec-snippets — pull request #1 by tacahilo (2014-11-15 08:00:11+00:00)
Title: Serverspec v2

Serverspec v2 removed some obsoleted matchers, so added new 'its' matchers instead.

- https://github.com/serverspec/serverspec/pull/464
- https://github.com/serverspec/serverspec/pull/465

### before

```ruby
describe command('command') do
it { should return_stdout 'foo' }
it { should return_stderr 'bar' }
it { should return_exit_status 0 }
end
describe file('/foo') do
it { should match_md5checksum('fdcb69b5c0e9beb7d392fbc458bc6beb')
it { should match_sha256sum('17feb8dc0817056a963c2861052d670b642c61f5625fae1fd59a2022be1dbb5b') }
end
```

### after

```ruby
describe command('command') do
its(:stdout) { should eq "foo\n" }
its(:stderr) { should match /bar/ }
its(:exit_status) { should eq 0 }
end
describe file('/foo') do
its(:md5sum) { should eq 'fdcb69b5c0e9beb7d392fbc458bc6beb' }
its(:sha256sum) { should eq '17feb8dc0817056a963c2861052d670b642c61f5625fae1fd59a2022be1dbb5b' }
end
```