Sha256: 2e396a8de3643f8b059798f718cb0c8339d3f19bd3520f29e0e5002b4236f89b

Contents?: true

Size: 527 Bytes

Versions: 17

Compression:

Stored size: 527 Bytes

Contents

module Rspec
  module Core
    class ExampleGroup
      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
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.beta.8 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.7 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.6 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.5 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.4 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.3 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.2 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.beta.1 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a10 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a9 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a8 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a7 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a6 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a5 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a4 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a3 lib/rspec/expectations/extensions/rspec/core/example_group.rb
rspec-expectations-2.0.0.a2 lib/rspec/expectations/extensions/rspec/core/example_group.rb