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.7.5 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.8 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.7 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.6 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.5 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.4 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.3 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.17 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.16 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/block_aliases.rb