Sha256: 869117263b23ad00219679b14b75b0f89f90b648cc2a76409366dbba3589c91a

Contents?: true

Size: 548 Bytes

Versions: 110

Compression:

Stored size: 548 Bytes

Contents

require 'rspec/expectations/extensions/kernel'
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

110 entries across 59 versions & 7 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.8 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.8 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.7 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.7 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/block_aliases.rb
classiccms-0.6.6 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/block_aliases.rb