Sha256: 8cdecaa39f5e8538ad23d950d46a92f9e5328b8f184d736556109d855ef24f40

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 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.expand_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',
        :haskell => '_test.hs',
      }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exercism-0.0.28 lib/exercism/submission.rb
exercism-0.0.27 lib/exercism/submission.rb