Sha256: f9b8dd5697c8004b454eec5d961cfd93e7c69ac5506cb4c168e430af8730b136

Contents?: true

Size: 559 Bytes

Versions: 11

Compression:

Stored size: 559 Bytes

Contents

module LearnTest
  class SpecTypeParser
    attr_reader :spec_type

    def initialize
      @spec_type = parse_spec_type
    end

    private

    def parse_spec_type
      files = Dir.entries('.')

      if files.include?('requires.yml')
        'jasmine'
      elsif files.any? {|f| f.match(/.*.py$/) }
        'python_unittest'
      elsif files.include?('spec')
        spec_files = Dir.entries('./spec')
        if spec_files.include?('spec_helper.rb') || spec_files.include?('rails_helper.rb')
          'rspec'
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
learn-test-1.2.26 lib/learn_test/spec_type_parser.rb
learn-test-1.2.25 lib/learn_test/spec_type_parser.rb
learn-test-1.2.24 lib/learn_test/spec_type_parser.rb
learn-test-1.2.23 lib/learn_test/spec_type_parser.rb
learn-test-1.2.22 lib/learn_test/spec_type_parser.rb
learn-test-1.2.21 lib/learn_test/spec_type_parser.rb
learn-test-1.2.2 lib/learn_test/spec_type_parser.rb
learn-test-1.2.1 lib/learn_test/spec_type_parser.rb
learn-test-1.2.0 lib/learn_test/spec_type_parser.rb
learn-test-1.1.1 lib/learn_test/spec_type_parser.rb
learn-test-1.1.0 lib/learn_test/spec_type_parser.rb