Skip to content

Instantly share code, notes, and snippets.

@Kgirthofer
Created December 9, 2015 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kgirthofer/b1b35c8cb3ae86fb410c to your computer and use it in GitHub Desktop.
Save Kgirthofer/b1b35c8cb3ae86fb410c to your computer and use it in GitHub Desktop.
def set_type
if @type == 'policy' or @type == ''
@status = 'policy'
puts @type
elsif @type == 'role'
@status = 'role'
puts @type
else
@status = 'error'
end
end
## RSPEC
describe "#set_type" do
it {is_expected.to respond_to :set_type}
context '--type is policy' do
let(:type) { 'policy' }
it {expect(subject.status).to eq 'policy'}
end
context '--type is role' do
let(:type) { 'role' }
it {expect(subject.status).to eq 'role'}
end
context '--type is nil' do
let(:type) { '' }
it {expect(subject.status).to eq 'policy'}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment