Sha256: 18b8e9dc48a20769589bf3ffe492d199f16af054e7b82075d0d8c925314d7310

Contents?: true

Size: 1.06 KB

Versions: 47

Compression:

Stored size: 1.06 KB

Contents

module RR
  module DoubleDefinitions
    module Strategies
      module Verification
        # This method sets the Double to have a dont_allow strategy.
        # A dont_allow strategy sets the default state of the Double
        # to expect never to be called. The Double's expectations can be
        # changed.
        #
        # The following example sets the expectation that subject.method_name
        # will never be called with arg1 and arg2.
        #
        #   do_not_allow(subject).method_name(arg1, arg2)
        #
        # dont_allow also supports a block sytnax.
        #    dont_allow(subject) do |m|
        #      m.method1 # Do not allow method1 with any arguments
        #      m.method2(arg1, arg2) # Do not allow method2 with arguments arg1 and arg2
        #      m.method3.with_no_args # Do not allow method3 with no arguments
        #    end        
        class DontAllow < VerificationStrategy
          protected
          def do_call
            definition.never
            permissive_argument
          end
        end
      end
    end
  end
end

Version data entries

47 entries across 43 versions & 5 rubygems

Version Path
rr-1.1.0.rc2 lib/rr/double_definitions/strategies/verification/dont_allow.rb
rr-1.1.0.rc1 lib/rr/double_definitions/strategies/verification/dont_allow.rb
rr-1.0.5 lib/rr/double_definitions/strategies/verification/dont_allow.rb
rr-1.0.5.rc2 lib/rr/double_definitions/strategies/verification/dont_allow.rb
rr-1.0.5.rc1 lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
bitclust-core-0.5.1 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/double_definitions/strategies/verification/dont_allow.rb
mcmire-rr-1.0.5.rc1 lib/rr/double_definitions/strategies/verification/dont_allow.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/dont_allow.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/dont_allow.rb
rr-1.0.4 lib/rr/double_definitions/strategies/verification/dont_allow.rb
rr-1.0.3 lib/rr/double_definitions/strategies/verification/dont_allow.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/dont_allow.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/dont_allow.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/dont_allow.rb