Sha256: 236cd1d578d5d49c9a440d47f477a3371a4de8c87491727c8960eb42432e107d

Contents?: true

Size: 755 Bytes

Versions: 15

Compression:

Stored size: 755 Bytes

Contents

module Spec
  module Matchers
    module SpecExtensions
      # Mainly extensions, these methods are inherent in all of the matchers
      # and are intended for helping parse the final manifest for spec'ing purposes.
      class SpecExtensionsBase
        def ensured_as(ensured="present")
          str = "ensure => '#{ensured}'"
          !grab_entry.scan(/#{str}/).empty?
        end
        def is_present?
          !grab_entry.empty? && is_valid_resource?
        end
        def grab_entry
          @target.grab_entry_for(type, @expected)
        end
        def type
          "file"
        end
        def is_valid_resource?
          grab_entry.split(/\n/).select {|l| l.match(/(.*)=>(\W+),$/) }.empty?
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
auser-poolparty-0.2.72 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.74 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.76 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.77 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.78 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.79 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.80 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.81 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.84 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.85 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.88 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.89 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.90 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
auser-poolparty-0.2.91 lib/poolparty/spec/matchers/a_spec_extensions_base.rb
poolparty-0.2.84 lib/poolparty/spec/matchers/a_spec_extensions_base.rb