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
rspec-expectations-2.9.0.rc2 lib/rspec/matchers/block_aliases.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.8.0/lib/rspec/matchers/block_aliases.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.8.0/lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.8.0 lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.8.0.rc2 lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.8.0.rc1 lib/rspec/matchers/block_aliases.rb