Sha256: 1afb331fc73ba9e37cfc798ae9948b0272471c76f2b99888149a3a699f0f8606

Contents?: true

Size: 804 Bytes

Versions: 29

Compression:

Stored size: 804 Bytes

Contents

module Spec
  module Matchers
    module SpecExtensions
      class HaveDirectory < SpecExtensionsBase
        def initialize(expected,extra="")
          @expected = expected
          @extra = extra
        end
        def matches?(target)
          @target = target
          is_present? && is_a_directory?
        end
        def is_a_directory?
          ensured_as("directory")
        end
        def failure_message
          "expected #{@target.inspect} to have directory #{@expected}"
        end
        def negative_failure_message
          "expected #{@target.inspect} not to have directory #{@expected}"
        end
        def type
          "file"
        end
      end
    end
    def have_directory(name, extra="")
      SpecExtensions::HaveDirectory.new(name, extra)
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
auser-poolparty-1.1.3 lib/poolparty/spec/matchers/have_directory.rb
auser-poolparty-1.1.4 lib/poolparty/spec/matchers/have_directory.rb
auser-poolparty-1.1.5 lib/poolparty/spec/matchers/have_directory.rb
auser-poolparty-1.1.6 lib/poolparty/spec/matchers/have_directory.rb
auser-poolparty-1.1.7 lib/poolparty/spec/matchers/have_directory.rb
fairchild-poolparty-1.1.3 lib/poolparty/spec/matchers/have_directory.rb
fairchild-poolparty-1.1.4 lib/poolparty/spec/matchers/have_directory.rb
fairchild-poolparty-1.1.5 lib/poolparty/spec/matchers/have_directory.rb
poolparty-0.2.84 lib/poolparty/spec/matchers/have_directory.rb