Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created November 1, 2009 19:30
Show Gist options
  • Select an option

  • Save ukstudio/223674 to your computer and use it in GitHub Desktop.

Select an option

Save ukstudio/223674 to your computer and use it in GitHub Desktop.
class Sample
def public_method
"public"
end
private
def private_method
"private"
end
end
require 'sample'
describe Sample do
it 'public' do
sample = Sample.new
sample.public_method.should == "public"
end
it 'private' do
sample = Sample.new
sample.send(:private_method).should == "private"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment