Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created June 15, 2011 07:31
Show Gist options
  • Save ukstudio/1026645 to your computer and use it in GitHub Desktop.
Save ukstudio/1026645 to your computer and use it in GitHub Desktop.
require 'rspec'
class Dummy
attr_reader :arg
def initialize(arg)
@arg = arg
end
end
describe 'raise' do
context 'no arg' do
subject { lambda { Dummy.new } }
it { should raise_error }
end
context 'with arg' do
subject { Dummy.new('arg') }
its(:arg) { should eq 'arg' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment