Sha256: 1e37b47494b90930b8f293041ff8dda593e27330ce1bb0253139241ea6aa77cd

Contents?: true

Size: 477 Bytes

Versions: 11

Compression:

Stored size: 477 Bytes

Contents

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

    # Extends the submitted block with aliases to and to_not
    # for should and should_not. Allows expectations like this:
    #
    #   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

11 entries across 11 versions & 2 rubygems

Version Path
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.4.0 lib/rspec/matchers/block_aliases.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.3.0 lib/rspec/matchers/block_aliases.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.2.0 lib/rspec/matchers/block_aliases.rb
rspec-expectations-2.1.0 lib/rspec/matchers/block_aliases.rb