2014-06-15 13:19:13 +03:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'compiler'
|
|
|
|
|
|
|
|
module Libv8::Compiler
|
|
|
|
describe Clang do
|
|
|
|
subject { Clang.new 'c++' }
|
|
|
|
|
|
|
|
describe '#name' do
|
|
|
|
it 'returns clang' do
|
2015-07-05 17:17:22 +03:00
|
|
|
expect(subject.name).to eq 'clang'
|
2014-06-15 13:19:13 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#version' do
|
|
|
|
it 'returns the version of the compiler' do
|
|
|
|
stub_as_available 'c++', :clang, '3.4.1'
|
2015-07-05 17:17:22 +03:00
|
|
|
expect(subject.version).to eq '3.4.1'
|
2014-06-15 13:19:13 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#compatible?' do
|
|
|
|
context 'when clang\'s version is >= 3.1' do
|
|
|
|
it 'returns true' do
|
|
|
|
stub_as_available 'c++', :clang, '3.4.1'
|
2015-07-05 17:17:22 +03:00
|
|
|
expect(subject).to be_compatible
|
2014-06-15 13:19:13 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|