Sha256: 4c9d278f3acd598c61d4237c713b45514605a1aed0bd88fb0d865acf40943a0e

Contents?: true

Size: 900 Bytes

Versions: 7

Compression:

Stored size: 900 Bytes

Contents

module OpalSpec
  class ExpectationNotMetError < StandardError; end

  module Expectations
    def should matcher = nil
      if matcher
        matcher.match self
      else
        OpalSpec::PositiveOperatorMatcher.new self
      end
    end

    def should_not matcher = nil
      if matcher
        matcher.not_match self
      else
        OpalSpec::NegativeOperatorMatcher.new self
      end
    end

    def be_kind_of expected
      OpalSpec::BeKindOfMatcher.new expected
    end

    def be_nil
      OpalSpec::BeNilMatcher.new nil
    end

    def be_true
      OpalSpec::BeTrueMatcher.new true
    end

    def be_false
      OpalSpec::BeFalseMatcher.new false
    end

    def equal expected
      OpalSpec::EqualMatcher.new expected
    end

    def raise_error expected
      OpalSpec::RaiseErrorMatcher.new expected
    end
  end
end

class Object
  include OpalSpec::Expectations
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opal-spec-0.2.5 lib/opal-spec/expectations.rb
opal-spec-0.2.1 lib/opal-spec/expectations.rb
opal-spec-0.2.0 lib/opal-spec/expectations.rb
opal-spec-0.1.6 lib/opal-spec/expectations.rb
opal-spec-0.1.5 lib/opal-spec/expectations.rb
opal-spec-0.1.1 lib/opal-spec/expectations.rb
opal-spec-0.0.3 lib/opal/spec/expectations.rb