Sha256: 523fabac8ff4eacf32d42b47ab1c532d07d33f4f0f7159ab49c10d12093b92c0

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')

describe 'method call matcher' do    
  context "content without method call" do
    not_call = %q{
        def hello
        end}    
    
    it "should not have call hello" do            
      not_call.should_not have_call :hello do |content|
        puts content
      end
    end
  end
  
  context "content with call hello" do  
    call = 'hello'
    it "should have call to hello" do            
      call.should have_call :hello do |content|
        puts "content: #{content}"
      end
    end
  end
  
  context "content with call hello" do  
    call = %q{
      def hello
        x.hello
      end}
    it "should have call to hello" do            
      call.should have_dot_call :hello do |content|
        puts "content: #{content}"
      end
    end
  end  
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generator-spec-0.4.8 spec/generator_spec/matchers/content/have_call_spec.rb