require 'helper' class TestImplementation < Test::Unit::TestCase context 'C++ implementation' do should 'initialize with information in a file' do gpp = Jeka::Compiler::Gpp.new([File.join(File.dirname(__FILE__), 'bubble_sort', 'cpp', 'bubble_sort.cpp')], {:o => 'bubble_sort_cpp'}) imp = Jeka::Implementation.new('c++') imp.information = File.join(File.dirname(__FILE__), 'bubble_sort', 'cpp', '_implementation.yaml') imp.compiler = gpp assert_equal 'c++', imp.name assert_equal 'c++', imp.information[:language] assert_equal 'Simple implementation in C++', imp.information[:comment] assert imp.compiler end should 'initialize with information in a hash' do gpp = Jeka::Compiler::Gpp.new([File.join(File.dirname(__FILE__), 'bubble_sort', 'cpp', 'bubble_sort.cpp')], {:o => 'bubble_sort_cpp'}) imp = Jeka::Implementation.new('c++') imp.information = {language: 'c++', comment: 'Simple implementation in C++'} imp.compiler = gpp assert_equal 'c++', imp.name assert_equal 'c++', imp.information[:language] assert_equal 'Simple implementation in C++', imp.information[:comment] assert imp.compiler end end end