Sha256: 5342061fc32f8d7b8f510543caba1dd7f8dc9bf1410398e1f205d0435a42604a

Contents?: true

Size: 1.27 KB

Versions: 42

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'
require 'compiler'

module Libv8::Compiler
  describe GenericCompiler do
    subject { GenericCompiler.new 'c++' }

    describe '#name' do
      it 'returns just the base name of the command' do
        expect(GenericCompiler.new('/usr/sbin/c++').name).to eq 'c++'
      end
    end

    describe '#to_s' do
      it 'should be the command used to call the compiler' do
        expect(subject.to_s).to eq 'c++'
      end
    end

    describe '#version' do
      it 'returns the version of the compiler' do
        stub_as_available 'c++', :clang, '3.4.1'
        expect(subject.version).to eq '3.4.1'
      end

      it 'returns nil when determining the version fails' do
        stub_as_unavailable 'c++'
        expect(subject.version).to be_nil
      end
    end

    describe '#target' do
      it 'returns the target of the compiler' do
        stub_as_available 'c++', :clang, '3.4.1'
        expect(subject.target).to eq 'x86_64-unknown-linux-gnu'
      end

      it 'returns nil when determining the target fails' do
        stub_as_unavailable 'c++'
        expect(subject.target).to be_nil
      end
    end

    describe '#compatible?' do
      it 'returns false' do
        expect(GenericCompiler.new('c++')).to_not be_compatible
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
libv8-6.3.292.48.1 spec/compiler/generic_compiler_spec.rb
libv8-6.3.292.48.0 spec/compiler/generic_compiler_spec.rb
libv8-6.3.292.48.0beta2 spec/compiler/generic_compiler_spec.rb
libv8-6.3.292.48.0beta1 spec/compiler/generic_compiler_spec.rb
libv8-6.2.414.42.1 spec/compiler/generic_compiler_spec.rb
libv8-6.2.414.42.0 spec/compiler/generic_compiler_spec.rb
libv8-6.2.414.42.0beta1 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.54.3 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.54.2 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.54.1 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.54.0 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.54.0beta2 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.54.0beta1 spec/compiler/generic_compiler_spec.rb
libv8-6.0.286.44.0beta1 spec/compiler/generic_compiler_spec.rb
libv8-5.9.211.38.1 spec/compiler/generic_compiler_spec.rb
libv8-5.9.211.38.0 spec/compiler/generic_compiler_spec.rb
libv8-5.9.211.38.0beta0 spec/compiler/generic_compiler_spec.rb
libv8-5.7.492.65.1 spec/compiler/generic_compiler_spec.rb
libv8-5.7.492.65.0 spec/compiler/generic_compiler_spec.rb
libv8-5.7.492.65.0beta1 spec/compiler/generic_compiler_spec.rb