Created
June 21, 2019 15:39
-
-
Save gangelo/769035129d0242500093a4aecb791d43 to your computer and use it in GitHub Desktop.
RSpec Helpers
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
# Call non-public methods directly to test | |
describe '#my_private_method' do | |
before do | |
Yardi::Yardi4LeaseTransfer.send(:public, *Yardi::Yardi4LeaseTransfer.private_instance_methods) | |
end | |
... | |
it 'should be able to call method directly' do | |
expect(object.my_private_method).to ... | |
end | |
end | |
describe '#my_protected_method' do | |
before do | |
Yardi::Yardi4LeaseTransfer.send(:public, *Yardi::Yardi4LeaseTransfer.protected_instance_methods) | |
end | |
... | |
it 'should be able to call method directly' do | |
expect(object.my_protected_method).to ... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment