Sha256: 65054c72f63bfe886d2405cf3dc831eeeaa82f31f6eb7f0f2ac99622d53f3b64

Contents?: true

Size: 1003 Bytes

Versions: 1

Compression:

Stored size: 1003 Bytes

Contents

require 'spec_helper'

describe 'block matcher' do    
  context "content without block" do
    not_class_self = %q{
        def hello
        end}    
    
    it "should not have block" do            
      not_class_self.should_not have_block :hello
    end
  end

  context "content with block: hello do" do  
    content = %q{
      hello do
        blip
      end # do}    

    it "should have block" do            
      content.should have_block :hello
    end
  end
  
  context "content with block: hello :angel do" do  
    content = %q{
      hello :angel do
        blip
      end # do}    

    it "should have block" do            
      content.should have_block :hello, :args => ':angel'
    end
  end

  context "content with block: hello :angel do |x,y|" do  
    content = %q{
      hello :angel do |x,y|
        blip
      end # do}    

    it "should have block" do            
      content.should have_block :hello, :args => ':angel', :block_args => 'x,y'
    end
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
code-spec-0.1.0 spec/code-spec/matchers/have_block_spec.rb