Sha256: d20b80f73681acbda184160edb85d9d51ca901109a1d56436e39c98cc13532c8

Contents?: true

Size: 860 Bytes

Versions: 9

Compression:

Stored size: 860 Bytes

Contents

module Spec
  class ExpectationNotMetError < StandardError; end

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

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

    def be_kind_of expected
      Spec::BeKindOfMatcher.new expected
    end

    def be_nil
      Spec::BeNilMatcher.new nil
    end

    def be_true
      Spec::BeTrueMatcher.new true
    end

    def be_false
      Spec::BeFalseMatcher.new false
    end

    def equal expected
      Spec::EqualMatcher.new expected
    end

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

class Object
  include Spec::Expectations
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
opal-spec-0.1.15 lib/opal/spec/expectations.rb
opal-spec-0.1.14 lib/opal/spec/expectations.rb
opal-spec-0.1.13 lib/opal/spec/expectations.rb
opal-spec-0.1.12 lib/opal/spec/expectations.rb
opal-spec-0.1.11 lib/opal/spec/expectations.rb
opal-spec-0.1.10 lib/opal/spec/expectations.rb
opal-spec-0.1.9 lib/opal/spec/expectations.rb
opal-spec-0.1.8 lib/opal/spec/expectations.rb
opal-spec-0.1.7 lib/opal/spec/expectations.rb