Sha256: 2d9d13b97722ddd48ec280c13eba4983276700907546c35a84b69f6a5fa34174

Contents?: true

Size: 549 Bytes

Versions: 9

Compression:

Stored size: 549 Bytes

Contents

module Spec
  module Matchers

    class Exist
      def matches?(actual)
        @actual = actual
        actual.exist?
      end

      def failure_message
        "expected #{@actual.inspect} to exist, but it doesn't."
      end

      def negative_failure_message
        "expected #{@actual.inspect} to not exist, but it does."
      end

      def description
        "exists"
      end
    end

    # :call-seq:
    #   should exist
    #   should_not exist
    #
    # Passes if actual.exist?
    def exist
      Exist.new
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dchelimsky-rspec-1.1.99.1 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.2 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.3 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.4 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.5 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.6 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.7 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.8 lib/spec/matchers/exist.rb
dchelimsky-rspec-1.1.99.9 lib/spec/matchers/exist.rb