Sha256: bfd4aab4a4a88bfab1dbe0e7c275c5022c504d15101663b0d832b52207651949

Contents?: true

Size: 501 Bytes

Versions: 66

Compression:

Stored size: 501 Bytes

Contents

module RSpec
  module Matchers
    module BlockAliases
      alias_method :to,     :should
      alias_method :to_not, :should_not
      alias_method :not_to, :should_not
    end

    # Extends the submitted block with aliases to and to_not
    # for should and should_not.
    #
    # @example
    #   expect { this_block }.to change{this.expression}.from(old_value).to(new_value)
    #   expect { this_block }.to raise_error
    def expect(&block)
      block.extend BlockAliases
    end
  end
end

Version data entries

66 entries across 65 versions & 6 rubygems

Version Path
classiccms-0.5.13 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.12 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.11 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.10 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.9 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.8 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.7 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.6 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.5 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.4.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.4.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.4.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.3.9 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.3.8 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.3.7 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.3.6 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.3.5 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb