Sha256: 95548e3468d60e62bf1f1049184ba24c049119a040d2991649d8015a6ce42ed5

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 Bytes

Contents

class Exercism
  class Submission

    def self.test?(file)
      new(file).test?
    end

    attr_reader :file
    def initialize(file)
      @file = file
    end

    def path
      File.absolute_path(file)
    end

    def test?
      test_identifiers.any? do |_, suffix|
        file.end_with?(suffix)
      end
    end

    def test_identifiers
      {
        :ruby => '_test.rb',
        :js => '.spec.js',
        :elixir => '_test.exs',
        :clojure => '_test.clj',
        :python => '_test.py',
        :go => '_test.go',
      }
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exercism-0.0.25 lib/exercism/submission.rb