Skip to content

Instantly share code, notes, and snippets.

@gangelo
Created June 21, 2019 15:39
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 gangelo/769035129d0242500093a4aecb791d43 to your computer and use it in GitHub Desktop.
Save gangelo/769035129d0242500093a4aecb791d43 to your computer and use it in GitHub Desktop.
RSpec Helpers
# 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