Sha256: 25965810b36ba6eb6f544fb2aa541635aacb522c690f58600abe4b31cb6821b2

Contents?: true

Size: 420 Bytes

Versions: 6

Compression:

Stored size: 420 Bytes

Contents

class Exercism
  class Submission

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

    attr_reader :file
    def initialize(file)
      @file = 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'
      }
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
exercism-0.0.24 lib/exercism/submission.rb
exercism-0.0.23 lib/exercism/submission.rb
exercism-0.0.22 lib/exercism/submission.rb
exercism-0.0.21 lib/exercism/submission.rb
exercism-0.0.20 lib/exercism/submission.rb
exercism-0.0.19 lib/exercism/submission.rb