-
-
Save Kgirthofer/b1b35c8cb3ae86fb410c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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