Sha256: e9ef7b7927076e149438581bff2fb331c7d1b9c12367cfc62c07c31b97d64b7c

Contents?: true

Size: 384 Bytes

Versions: 3

Compression:

Stored size: 384 Bytes

Contents

module RSpecSearchAndDestroy
  class LocationSource
    def enabled?
      filename && File.exist?(filename)
    end

    def example_locations_to_run
      raise "LocationSource is not currently enabled" unless enabled?

      File.open(filename, 'rb') do |f|
        Marshal.load(f)
      end
    end

    private

    def filename
      ENV['RSPEC_SAD_EXAMPLES']
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-search-and-destroy-0.0.4 lib/rspec-search-and-destroy/location_source.rb
rspec-search-and-destroy-0.0.3 lib/rspec-search-and-destroy/location_source.rb
rspec-search-and-destroy-0.0.2 lib/rspec-search-and-destroy/location_source.rb