Sha256: 417318abc654781bfa6a6a54e27bb795c4c7f9e04a2d0086d3c84c127a43cf44

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe Polytrix do
  describe '.find_implementor' do
    before do
      Polytrix.configuration.manifest = 'samples/polytrix.yml'
    end

    it 'returns nil if no implementor is found for the file' do
      tempfile = Tempfile.new(['foo', '.java'])
      expect(described_class.find_implementor tempfile.path).to be_nil
    end

    it 'finds implementors from by matching basedir to an already loaded implementor' do
      Polytrix.manifest.implementors['java'] = Fabricate(:implementor, name: 'java', basedir: 'samples/sdks/java')
      # Polytrix.configuration.implementor(
      #   name: 'java',
      #   basedir: 'samples/sdks/java'
      # )

      sample_file = 'samples/sdks/java/challenges/HelloWorld.java'
      implementor = described_class.find_implementor sample_file
      expect(implementor).to be_an_instance_of Polytrix::Implementor
      expect(implementor.name).to eq('java')
    end
  end

  describe '.validate' do
    context 'block given' do
      it 'creates and registers a validator' do
        Polytrix.validate suite: 'test', sample: 'test' do |challenge|
          # Validate the challenge results
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polytrix-0.1.0 spec/polytrix_spec.rb