Sha256: 718ab957d038a2a91dd50c1feb4b64be66ad39b169c767d583425602c000ef8f

Contents?: true

Size: 1.51 KB

Versions: 18

Compression:

Stored size: 1.51 KB

Contents

module Kernel
  # :call-seq:
  #   should(matcher)
  #   should == expected
  #   should === expected
  #   should =~ expected
  #
  #   receiver.should(matcher)
  #     => Passes if matcher.matches?(receiver)
  #
  #   receiver.should == expected #any value
  #     => Passes if (receiver == expected)
  #
  #   receiver.should === expected #any value
  #     => Passes if (receiver === expected)
  #
  #   receiver.should =~ regexp
  #     => Passes if (receiver =~ regexp)
  #
  # See Rspec::Matchers for more information about matchers
  #
  # == Warning
  #
  # NOTE that this does NOT support receiver.should != expected.
  # Instead, use receiver.should_not == expected
  def should(matcher=nil, message=nil, &block)
    Rspec::Expectations::PositiveExpectationHandler.handle_matcher(self, matcher, message, &block)
  end
  
  # :call-seq:
  #   should_not(matcher)
  #   should_not == expected
  #   should_not === expected
  #   should_not =~ expected
  #
  #   receiver.should_not(matcher)
  #     => Passes unless matcher.matches?(receiver)
  #
  #   receiver.should_not == expected
  #     => Passes unless (receiver == expected)
  #
  #   receiver.should_not === expected
  #     => Passes unless (receiver === expected)
  #
  #   receiver.should_not =~ regexp
  #     => Passes unless (receiver =~ regexp)
  #
  # See Rspec::Matchers for more information about matchers
  def should_not(matcher=nil, message=nil, &block)
    Rspec::Expectations::NegativeExpectationHandler.handle_matcher(self, matcher, message, &block)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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