Created
          June 15, 2011 07:31 
        
      - 
      
- 
        Save ukstudio/1026645 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | 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