Sha256: 69bb13c0a9d6d14be68cb32e5f665e0a08d620f1113d545fdb6b5859a6c0d06c
Contents?: true
Size: 1.47 KB
Versions: 3
Compression:
Stored size: 1.47 KB
Contents
require File.dirname(__FILE__) + '/../unit_test_helper' require 'ceedling/preprocessinator_file_handler' class PreprocessinatorFileHandlerTest < Test::Unit::TestCase def setup objects = create_mocks(:preprocessinator_extractor, :configurator, :tool_executor, :file_path_utils, :file_wrapper) @preprocessinator_file_handler = PreprocessinatorFileHandler.new(objects) end def teardown end should "preprocess a file" do create_mock(:tool_config) expected_file = %Q[ #include "other_file.h" #include "file.h" #include "protobuf.pb-c.h" void foo(void) { } ].left_margin(0) @file_path_utils.expects.form_preprocessed_file_path('project/source/file.c').returns('project/build/preprocessed/files/file.c') @configurator.expects.tools_file_preprocessor.returns(@tool_config) @tool_executor.expects.build_command_line(@tool_config, 'project/source/file.c', 'project/build/preprocessed/files/file.c').returns('boring command line') @tool_executor.expects.exec('boring command line').returns('') @preprocessinator_extractor.expects.extract_base_file_from_preprocessed_expansion('project/build/preprocessed/files/file.c').returns(['', 'void foo(void)', '{', '}']) @file_wrapper.expects.write('project/build/preprocessed/files/file.c', expected_file.strip) @preprocessinator_file_handler.preprocess_file('project/source/file.c', ['file.h', 'other_file.h']) end end
Version data entries
3 entries across 3 versions & 1 rubygems