Sha256: e5b991e9511e14ccbba1fc687543fc557d79bda83b0343dcb48639fc37afbf0c

Contents?: true

Size: 824 Bytes

Versions: 16

Compression:

Stored size: 824 Bytes

Contents

require 'spec_helper'

describe 'method calls matcher' do    
  context "content without calls" do
    not_class_self = %q{
        def x
        end
  
        def y
        end        
        }    
    
    it "should not have calls to x or y" do            
      not_class_self.should_not have_calls :x, :y
    end
  end
  
  context "content with calls to x and y" do  
    class_self = %q{
        def x
          x
          y
        end}    

    it "should have calls to x and y" do            
      class_self.should have_calls :x, :y
    end
  end

  context "content with calls to x and y" do  
    class_self = %q{
        def x
          x(2)
          y 3
        end}    
  
    it "should have calls: x(2) and y 3" do            
      class_self.should have_calls :x => '2', :y => '3'
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
code-spec-0.4.0 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.3.0 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.11 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.9 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.8 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.7 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.6 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.5 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.4 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.3 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.2 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.1 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.2.0 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.1.3 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.1.2 spec/code-spec/matchers/have_calls_spec.rb
code-spec-0.1.0 spec/code-spec/matchers/have_calls_spec.rb