ceedling 0.15.4 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +9 -13
- data/README.md +0 -4
- data/Rakefile +2 -6
- data/bin/ceedling +1 -1
- data/ceedling.gemspec +2 -3
- data/lib/ceedling/configurator_builder.rb +70 -63
- data/lib/ceedling/defaults.rb +21 -17
- data/lib/ceedling/dependinator.rb +12 -4
- data/lib/ceedling/generator.rb +1 -3
- data/lib/ceedling/generator_test_runner.rb +2 -2
- data/lib/ceedling/tasks_base.rake +16 -9
- data/lib/ceedling/version.rb +1 -1
- data/lib/ceedling/version.rb.erb +16 -0
- data/release/build.info +2 -0
- data/release/version.info +1 -0
- data/spec/ceedling_spec.rb +27 -27
- data/spec/par_map_spec.rb +8 -8
- data/spec/preprocessinator_extractor_spec.rb +2 -2
- data/spec/preprocessinator_includes_handler_spec.rb +24 -24
- data/spec/spec_helper.rb +3 -3
- data/spec/spec_system_helper.rb +13 -13
- data/spec/system/deployment_spec.rb +9 -9
- data/test_graveyard/unit/busted/configurator_builder_test.rb +70 -68
- metadata +17 -20
data/lib/ceedling/defaults.rb
CHANGED
@@ -42,24 +42,30 @@ DEFAULT_TEST_FIXTURE_TOOL = {
|
|
42
42
|
:arguments => [].freeze
|
43
43
|
}
|
44
44
|
|
45
|
+
|
46
|
+
|
45
47
|
DEFAULT_TEST_INCLUDES_PREPROCESSOR_TOOL = {
|
46
|
-
:executable => FilePathUtils.os_executable_ext('
|
48
|
+
# :executable => FilePathUtils.os_executable_ext('cpp').freeze, # disabled for OSX clang
|
49
|
+
:executable => FilePathUtils.os_executable_ext('gcc').freeze, # OSX clang
|
47
50
|
:name => 'default_test_includes_preprocessor'.freeze,
|
48
51
|
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
49
52
|
:background_exec => BackgroundExec::NONE.freeze,
|
50
53
|
:optional => false.freeze,
|
51
54
|
:arguments => [
|
52
|
-
'-E'.freeze,
|
55
|
+
'-E'.freeze, # OSX clang
|
53
56
|
'-MM'.freeze,
|
54
57
|
'-MG'.freeze,
|
55
58
|
# avoid some possibility of deep system lib header file complications by omitting vendor paths
|
56
59
|
# if cpp is run on *nix system, escape spaces in paths; if cpp on windows just use the paths collection as is
|
57
|
-
{"-I\"$\"" => "{SystemWrapper.windows? ? COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE : COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE.map{|path| path.gsub(\/ \/, \'\\\\ \') }}"}.freeze,
|
60
|
+
# {"-I\"$\"" => "{SystemWrapper.windows? ? COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE : COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE.map{|path| path.gsub(\/ \/, \'\\\\ \') }}"}.freeze,
|
61
|
+
{"-I$" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
|
62
|
+
{"-I$" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
|
58
63
|
{"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
|
59
64
|
{"-D$" => 'DEFINES_TEST_PREPROCESS'}.freeze,
|
60
|
-
"-
|
65
|
+
# "-DGNU_PREPROCESSOR".freeze,
|
66
|
+
"-DGNU_COMPILER".freeze, # OSX clang
|
61
67
|
'-w'.freeze,
|
62
|
-
'-nostdinc'.freeze,
|
68
|
+
# '-nostdinc'.freeze,
|
63
69
|
"\"${1}\"".freeze
|
64
70
|
].freeze
|
65
71
|
}
|
@@ -76,19 +82,13 @@ DEFAULT_TEST_FILE_PREPROCESSOR_TOOL = {
|
|
76
82
|
{"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
|
77
83
|
{"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
|
78
84
|
{"-D$" => 'DEFINES_TEST_PREPROCESS'}.freeze,
|
79
|
-
"-
|
85
|
+
"-DGNU_COMPILER".freeze,
|
86
|
+
# '-nostdinc'.freeze,
|
80
87
|
"\"${1}\"".freeze,
|
81
88
|
"-o \"${2}\"".freeze
|
82
89
|
].freeze
|
83
90
|
}
|
84
91
|
|
85
|
-
# Disable the -MD flag for OSX LLVM Clang, since unsupported
|
86
|
-
if RUBY_PLATFORM =~ /darwin/ && `gcc --version 2> /dev/null` =~ /Apple LLVM version .* \(clang/m # OSX w/LLVM Clang
|
87
|
-
MD_FLAG = '' # Clang doesn't support the -MD flag
|
88
|
-
else
|
89
|
-
MD_FLAG = '-MD'
|
90
|
-
end
|
91
|
-
|
92
92
|
DEFAULT_TEST_DEPENDENCIES_GENERATOR_TOOL = {
|
93
93
|
:executable => FilePathUtils.os_executable_ext('gcc').freeze,
|
94
94
|
:name => 'default_test_dependencies_generator'.freeze,
|
@@ -96,17 +96,19 @@ DEFAULT_TEST_DEPENDENCIES_GENERATOR_TOOL = {
|
|
96
96
|
:background_exec => BackgroundExec::NONE.freeze,
|
97
97
|
:optional => false.freeze,
|
98
98
|
:arguments => [
|
99
|
+
'-E'.freeze,
|
99
100
|
{"-I\"$\"" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
|
100
101
|
{"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
|
101
102
|
{"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
|
102
103
|
{"-D$" => 'DEFINES_TEST_PREPROCESS'}.freeze,
|
103
|
-
"-
|
104
|
+
"-DGNU_COMPILER".freeze,
|
104
105
|
"-MT \"${3}\"".freeze,
|
105
106
|
'-MM'.freeze,
|
106
|
-
|
107
|
+
# '-MD'.freeze, # OSX clang
|
107
108
|
'-MG'.freeze,
|
108
109
|
"-MF \"${2}\"".freeze,
|
109
110
|
"-c \"${1}\"".freeze,
|
111
|
+
# '-nostdinc'.freeze,
|
110
112
|
].freeze
|
111
113
|
}
|
112
114
|
|
@@ -117,17 +119,19 @@ DEFAULT_RELEASE_DEPENDENCIES_GENERATOR_TOOL = {
|
|
117
119
|
:background_exec => BackgroundExec::NONE.freeze,
|
118
120
|
:optional => false.freeze,
|
119
121
|
:arguments => [
|
122
|
+
'-E'.freeze,
|
120
123
|
{"-I\"$\"" => 'COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR'}.freeze,
|
121
124
|
{"-I\"$\"" => 'COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE'}.freeze,
|
122
125
|
{"-D$" => 'COLLECTION_DEFINES_RELEASE_AND_VENDOR'}.freeze,
|
123
126
|
{"-D$" => 'DEFINES_RELEASE_PREPROCESS'}.freeze,
|
124
|
-
"-
|
127
|
+
"-DGNU_COMPILER".freeze,
|
125
128
|
"-MT \"${3}\"".freeze,
|
126
129
|
'-MM'.freeze,
|
127
|
-
|
130
|
+
# '-MD'.freeze, # OSX clang
|
128
131
|
'-MG'.freeze,
|
129
132
|
"-MF \"${2}\"".freeze,
|
130
133
|
"-c \"${1}\"".freeze,
|
134
|
+
# '-nostdinc'.freeze,
|
131
135
|
].freeze
|
132
136
|
}
|
133
137
|
|
@@ -4,7 +4,7 @@ class Dependinator
|
|
4
4
|
constructor :configurator, :project_config_manager, :test_includes_extractor, :file_path_utils, :rake_wrapper, :file_wrapper
|
5
5
|
|
6
6
|
def touch_force_rebuild_files
|
7
|
-
@file_wrapper.touch( @configurator.project_test_force_rebuild_filepath )
|
7
|
+
@file_wrapper.touch( @configurator.project_test_force_rebuild_filepath )
|
8
8
|
@file_wrapper.touch( @configurator.project_release_force_rebuild_filepath ) if (@configurator.project_release_build)
|
9
9
|
end
|
10
10
|
|
@@ -16,8 +16,9 @@ class Dependinator
|
|
16
16
|
|
17
17
|
|
18
18
|
def enhance_release_file_dependencies(files)
|
19
|
-
files.each do |filepath|
|
19
|
+
files.each do |filepath|
|
20
20
|
@rake_wrapper[filepath].enhance( [@configurator.project_release_force_rebuild_filepath] ) if (@project_config_manager.release_config_changed)
|
21
|
+
@rake_wrapper[filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -31,12 +32,14 @@ class Dependinator
|
|
31
32
|
|
32
33
|
def enhance_runner_dependencies(runner_filepath)
|
33
34
|
@rake_wrapper[runner_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
35
|
+
@rake_wrapper[runner_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
34
36
|
end
|
35
|
-
|
37
|
+
|
36
38
|
|
37
39
|
def enhance_shallow_include_lists_dependencies(include_lists)
|
38
40
|
include_lists.each do |include_list_filepath|
|
39
41
|
@rake_wrapper[include_list_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
42
|
+
@rake_wrapper[include_list_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
@@ -44,6 +47,7 @@ class Dependinator
|
|
44
47
|
def enhance_preprocesed_file_dependencies(files)
|
45
48
|
files.each do |filepath|
|
46
49
|
@rake_wrapper[filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
50
|
+
@rake_wrapper[filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
@@ -53,6 +57,7 @@ class Dependinator
|
|
53
57
|
mocks_list.each do |mock_filepath|
|
54
58
|
@rake_wrapper[mock_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
55
59
|
@rake_wrapper[mock_filepath].enhance( [@configurator.cmock_unity_helper] ) if (@configurator.cmock_unity_helper)
|
60
|
+
@rake_wrapper[mock_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
56
61
|
@rake_wrapper[mock_filepath].enhance( [@configurator.cmock_build_info_filepath] )
|
57
62
|
end
|
58
63
|
end
|
@@ -61,6 +66,7 @@ class Dependinator
|
|
61
66
|
def enhance_dependencies_dependencies(dependencies)
|
62
67
|
dependencies.each do |dependencies_filepath|
|
63
68
|
@rake_wrapper[dependencies_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
69
|
+
@rake_wrapper[dependencies_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
64
70
|
end
|
65
71
|
end
|
66
72
|
|
@@ -68,12 +74,14 @@ class Dependinator
|
|
68
74
|
def enhance_test_build_object_dependencies(objects)
|
69
75
|
objects.each do |object_filepath|
|
70
76
|
@rake_wrapper[object_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
77
|
+
@rake_wrapper[object_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
71
78
|
end
|
72
79
|
end
|
73
|
-
|
80
|
+
|
74
81
|
|
75
82
|
def enhance_results_dependencies(result_filepath)
|
76
83
|
@rake_wrapper[result_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
|
84
|
+
@rake_wrapper[result_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
|
77
85
|
end
|
78
86
|
|
79
87
|
|
data/lib/ceedling/generator.rb
CHANGED
@@ -66,11 +66,9 @@ class Generator
|
|
66
66
|
|
67
67
|
@streaminator.stdout_puts("Generating runner for #{module_name}...", Verbosity::NORMAL)
|
68
68
|
|
69
|
-
test_file_includes = [] # Empty list for now, since apparently unused
|
70
|
-
|
71
69
|
# build runner file
|
72
70
|
begin
|
73
|
-
@generator_test_runner.generate(module_name, runner_filepath, test_cases, mock_list,
|
71
|
+
@generator_test_runner.generate(module_name, runner_filepath, test_cases, mock_list, [])
|
74
72
|
rescue
|
75
73
|
raise
|
76
74
|
ensure
|
@@ -52,13 +52,13 @@ class GeneratorTestRunner
|
|
52
52
|
return tests_and_line_numbers
|
53
53
|
end
|
54
54
|
|
55
|
-
def generate(module_name, runner_filepath, test_cases, mock_list,
|
55
|
+
def generate(module_name, runner_filepath, test_cases, mock_list, mock_includes)
|
56
56
|
require 'generate_test_runner.rb'
|
57
57
|
@test_runner_generator ||= UnityTestRunnerGenerator.new( @configurator.get_runner_config )
|
58
58
|
@test_runner_generator.generate( module_name,
|
59
59
|
runner_filepath,
|
60
60
|
test_cases,
|
61
61
|
mock_list,
|
62
|
-
|
62
|
+
mock_includes)
|
63
63
|
end
|
64
64
|
end
|
@@ -1,36 +1,38 @@
|
|
1
1
|
require 'ceedling/constants'
|
2
2
|
require 'ceedling/file_path_utils'
|
3
|
-
|
3
|
+
|
4
4
|
|
5
5
|
desc "Display build environment version info."
|
6
6
|
task :version do
|
7
|
-
|
8
|
-
|
9
|
-
[
|
7
|
+
tools = [
|
8
|
+
[' Ceedling', CEEDLING_ROOT],
|
10
9
|
['CException', File.join( CEEDLING_VENDOR, CEXCEPTION_ROOT_PATH)],
|
11
10
|
[' CMock', File.join( CEEDLING_VENDOR, CMOCK_ROOT_PATH)],
|
12
11
|
[' Unity', File.join( CEEDLING_VENDOR, UNITY_ROOT_PATH)],
|
13
|
-
|
12
|
+
]
|
13
|
+
|
14
|
+
tools.each do |tool|
|
14
15
|
name = tool[0]
|
15
16
|
base_path = tool[1]
|
16
|
-
|
17
|
+
|
17
18
|
version_string = @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'version.info') ).strip
|
18
19
|
build_string = @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'build.info') ).strip
|
19
20
|
puts "#{name}:: #{version_string.empty? ? '#.#.' : (version_string + '.')}#{build_string.empty? ? '?' : build_string}"
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
24
|
+
|
23
25
|
desc "Set verbose output (silent:[#{Verbosity::SILENT}] - obnoxious:[#{Verbosity::OBNOXIOUS}])."
|
24
26
|
task :verbosity, :level do |t, args|
|
25
27
|
verbosity_level = args.level.to_i
|
26
|
-
|
28
|
+
|
27
29
|
if (PROJECT_USE_MOCKS)
|
28
30
|
# don't store verbosity level in setupinator's config hash, use a copy;
|
29
31
|
# otherwise, the input configuration will change and trigger entire project rebuilds
|
30
32
|
hash = @ceedling[:setupinator].config_hash[:cmock].clone
|
31
33
|
hash[:verbosity] = verbosity_level
|
32
34
|
|
33
|
-
@ceedling[:cmock_builder].manufacture( hash )
|
35
|
+
@ceedling[:cmock_builder].manufacture( hash )
|
34
36
|
end
|
35
37
|
|
36
38
|
@ceedling[:configurator].project_verbosity = verbosity_level
|
@@ -39,11 +41,13 @@ task :verbosity, :level do |t, args|
|
|
39
41
|
verbose( ((verbosity_level >= Verbosity::OBNOXIOUS) ? true : false) )
|
40
42
|
end
|
41
43
|
|
44
|
+
|
42
45
|
desc "Enable logging"
|
43
46
|
task :logging do
|
44
47
|
@ceedling[:configurator].project_logging = true
|
45
48
|
end
|
46
49
|
|
50
|
+
|
47
51
|
# non advertised debug task
|
48
52
|
task :debug do
|
49
53
|
Rake::Task[:verbosity].invoke(Verbosity::DEBUG)
|
@@ -51,12 +55,14 @@ task :debug do
|
|
51
55
|
@ceedling[:configurator].project_debug = true
|
52
56
|
end
|
53
57
|
|
58
|
+
|
54
59
|
# non advertised sanity checking task
|
55
60
|
task :sanity_checks, :level do |t, args|
|
56
61
|
check_level = args.level.to_i
|
57
62
|
@ceedling[:configurator].sanity_checks = check_level
|
58
63
|
end
|
59
64
|
|
65
|
+
|
60
66
|
# list expanded environment variables
|
61
67
|
if (not ENVIRONMENT.empty?)
|
62
68
|
desc "List all configured environment variables."
|
@@ -66,10 +72,11 @@ task :environment do
|
|
66
72
|
name = key.to_s.upcase
|
67
73
|
puts " - #{name}: \"#{env[key]}\""
|
68
74
|
end
|
69
|
-
end
|
75
|
+
end
|
70
76
|
end
|
71
77
|
end
|
72
78
|
|
79
|
+
|
73
80
|
namespace :options do
|
74
81
|
|
75
82
|
COLLECTION_PROJECT_OPTIONS.each do |option_path|
|
data/lib/ceedling/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# @private
|
2
|
+
module Ceedling
|
3
|
+
module Version
|
4
|
+
# @private
|
5
|
+
GEM = "0.15.5"
|
6
|
+
|
7
|
+
# @private
|
8
|
+
CEEDLING = "<%= versions["CEEDLING"] %>"
|
9
|
+
# @private
|
10
|
+
CEXCEPTION = "<%= versions["CEXCEPTION"] %>"
|
11
|
+
# @private
|
12
|
+
CMOCK = "<%= versions["CMOCK"] %>"
|
13
|
+
# @private
|
14
|
+
UNITY = "<%= versions["UNITY"] %>"
|
15
|
+
end
|
16
|
+
end
|
data/release/build.info
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.15.1
|
data/spec/ceedling_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe 'Ceedling' do
|
|
10
10
|
# execute method
|
11
11
|
location = Ceedling.location
|
12
12
|
# validate results
|
13
|
-
|
13
|
+
location.should == ceedling_path
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -23,7 +23,7 @@ describe 'Ceedling' do
|
|
23
23
|
# execute method
|
24
24
|
location = Ceedling.load_path
|
25
25
|
# validate results
|
26
|
-
|
26
|
+
location.should == load_path
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -36,7 +36,7 @@ describe 'Ceedling' do
|
|
36
36
|
# execute method
|
37
37
|
location = Ceedling.rakefile
|
38
38
|
# validate results
|
39
|
-
|
39
|
+
location.should == rakefile_path
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -47,11 +47,11 @@ describe 'Ceedling' do
|
|
47
47
|
rakefile_path = File.join(File.dirname(__FILE__), '..').gsub('spec','lib')
|
48
48
|
rakefile_path = File.join( rakefile_path, 'lib', 'ceedling', 'rakefile.rb' )
|
49
49
|
# mocks/stubs/expected calls
|
50
|
-
|
50
|
+
Ceedling.should_receive(:load).with(rakefile_path)
|
51
51
|
# execute method
|
52
52
|
Ceedling.load_project
|
53
53
|
# validate results
|
54
|
-
|
54
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './project.yml'
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'should load the project with the specified yaml file' do
|
@@ -60,11 +60,11 @@ describe 'Ceedling' do
|
|
60
60
|
rakefile_path = File.join(File.dirname(__FILE__), '..').gsub('spec','lib')
|
61
61
|
rakefile_path = File.join( rakefile_path, 'lib', 'ceedling', 'rakefile.rb' )
|
62
62
|
# mocks/stubs/expected calls
|
63
|
-
|
63
|
+
Ceedling.should_receive(:load).with(rakefile_path)
|
64
64
|
# execute method
|
65
65
|
Ceedling.load_project(config: './foo.yml')
|
66
66
|
# validate results
|
67
|
-
|
67
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './foo.yml'
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'should load the project with the yaml file specified by the existing environment variable' do
|
@@ -73,11 +73,11 @@ describe 'Ceedling' do
|
|
73
73
|
rakefile_path = File.join(File.dirname(__FILE__), '..').gsub('spec','lib')
|
74
74
|
rakefile_path = File.join( rakefile_path, 'lib', 'ceedling', 'rakefile.rb' )
|
75
75
|
# mocks/stubs/expected calls
|
76
|
-
|
76
|
+
Ceedling.should_receive(:load).with(rakefile_path)
|
77
77
|
# execute method
|
78
78
|
Ceedling.load_project
|
79
79
|
# validate results
|
80
|
-
|
80
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './bar.yml'
|
81
81
|
end
|
82
82
|
|
83
83
|
it 'should load the project with the specified plugins enabled' do
|
@@ -88,15 +88,15 @@ describe 'Ceedling' do
|
|
88
88
|
rakefile_path = File.join(File.dirname(__FILE__), '..').gsub('spec','lib')
|
89
89
|
rakefile_path = File.join( rakefile_path, 'lib', 'ceedling', 'rakefile.rb' )
|
90
90
|
# mocks/stubs/expected calls
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
Gem::Specification.should_receive(:find_by_name).with('ceedling-foo').and_return(spec_double)
|
92
|
+
spec_double.should_receive(:gem_dir).and_return('dummy/path')
|
93
|
+
Ceedling.should_receive(:require).with('ceedling/defaults')
|
94
|
+
Ceedling.should_receive(:load).with(rakefile_path)
|
95
95
|
# execute method
|
96
96
|
Ceedling.load_project( config: './foo.yml',
|
97
97
|
plugins: ['foo'])
|
98
98
|
# validate results
|
99
|
-
|
99
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './foo.yml'
|
100
100
|
end
|
101
101
|
|
102
102
|
it 'should set the project root if the root key is provided' do
|
@@ -107,13 +107,13 @@ describe 'Ceedling' do
|
|
107
107
|
rakefile_path = File.join(File.dirname(__FILE__), '..').gsub('spec','lib')
|
108
108
|
rakefile_path = File.join( rakefile_path, 'lib', 'ceedling', 'rakefile.rb' )
|
109
109
|
# mocks/stubs/expected calls
|
110
|
-
|
110
|
+
Ceedling.should_receive(:load).with(rakefile_path)
|
111
111
|
# execute method
|
112
112
|
Ceedling.load_project( config: './foo.yml',
|
113
113
|
root: './')
|
114
114
|
# validate results
|
115
|
-
|
116
|
-
|
115
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './foo.yml'
|
116
|
+
PROJECT_ROOT.should == './'
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -124,14 +124,14 @@ describe 'Ceedling' do
|
|
124
124
|
DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths].clear()
|
125
125
|
spec_double = double('spec-double')
|
126
126
|
# mocks/stubs/expected calls
|
127
|
-
|
128
|
-
|
129
|
-
|
127
|
+
Gem::Specification.should_receive(:find_by_name).with('ceedling-foo').and_return(spec_double)
|
128
|
+
spec_double.should_receive(:gem_dir).and_return('dummy/path')
|
129
|
+
Ceedling.should_receive(:require).with('ceedling/defaults')
|
130
130
|
# execute method
|
131
131
|
Ceedling.register_plugin('foo')
|
132
132
|
# validate results
|
133
|
-
|
134
|
-
|
133
|
+
DEFAULT_CEEDLING_CONFIG[:plugins][:enabled].should == ["foo"]
|
134
|
+
DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths].should == ["dummy/path"]
|
135
135
|
end
|
136
136
|
|
137
137
|
it 'should register a plugin with an alternative prefix' do
|
@@ -140,14 +140,14 @@ describe 'Ceedling' do
|
|
140
140
|
DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths].clear()
|
141
141
|
spec_double = double('spec-double')
|
142
142
|
# mocks/stubs/expected calls
|
143
|
-
|
144
|
-
|
145
|
-
|
143
|
+
Gem::Specification.should_receive(:find_by_name).with('prefix-foo').and_return(spec_double)
|
144
|
+
spec_double.should_receive(:gem_dir).and_return('dummy/path')
|
145
|
+
Ceedling.should_receive(:require).with('ceedling/defaults')
|
146
146
|
# execute method
|
147
147
|
Ceedling.register_plugin('foo','prefix-')
|
148
148
|
# validate results
|
149
|
-
|
150
|
-
|
149
|
+
DEFAULT_CEEDLING_CONFIG[:plugins][:enabled].should == ["foo"]
|
150
|
+
DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths].should == ["dummy/path"]
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|