mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-10-15 11:17:39 +08:00
Add support for :mock_suffix
Adds support for :mock_suffix when generating mock setup and teardown functions. Also documents both prefix and suffix in the helper script guide.
This commit is contained in:
@ -26,6 +26,7 @@ class UnityTestRunnerGenerator
|
||||
framework: :unity,
|
||||
test_prefix: 'test|spec|should',
|
||||
mock_prefix: 'Mock',
|
||||
mock_suffix: '',
|
||||
setup_name: 'setUp',
|
||||
teardown_name: 'tearDown',
|
||||
main_name: 'main', # set to :auto to automatically generate each time
|
||||
@ -148,7 +149,7 @@ class UnityTestRunnerGenerator
|
||||
mock_headers = []
|
||||
includes.each do |include_path|
|
||||
include_file = File.basename(include_path)
|
||||
mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}/i
|
||||
mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}.*#{@options[:mock_suffix]}$/i
|
||||
end
|
||||
mock_headers
|
||||
end
|
||||
|
Reference in New Issue
Block a user