Derek Derek - 2 years ago 94
Ruby Question

How do I test for the value of a variable in serverspec

I have a fairly simple task to complete. I'm writing a number of tests for a Chef project I'm working on. Serverspec gives you resources such as

, etc. What I want to do is simply check for the value of a variable, ie:

someVar = "some value dynamically determined"
describe someVar do

I'm sort of new to ruby, and I'm not exactly sure how to proceed.

Answer Source

This would just be standard RSpec:

describe someVar do
  it { be_nil }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download