diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-14 21:35:40 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-14 21:35:40 +0200 |
| commit | a2edd9ec657dca835ce1a73807a86a9c44fdfec8 (patch) | |
| tree | 678076fbd778b10264ed0b23857c8e5accdcc693 /Rakefile | |
| parent | 07e5f8d4402346ccb336cc0680cad98d0d5ba920 (diff) | |
initial tests
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 53 |
1 files changed, 5 insertions, 48 deletions
@@ -1,51 +1,8 @@ -require_relative 'lib/dsl' +require 'rake/testtask' -desc 'Set up wireguard mesh' -task :wireguard do - configure do - # p option :verbose - # dump_config - only_when { hostname is :earth } - - file '/tmp/test/wg/wg0.conf' do - create_parent_directory and from_template - - 'the content is here and the result is <%= 1 + 2 %>' - end - - file '/tmp/test/wg/wg1.conf' do - create_parent_directory and from_sourcefile - - './Rakefile' - end - end -end - -desc 'foo task' -task :foo do - configure do - file '/tmp/test.txt' do - %w[foo bar baz].sort - end - end +Rake::TestTask.new do |t| + t.libs << 'test' + t.test_files = FileList['test/**/*_test.rb'] end -desc 'Set up the /etc/hosts file' -task :hosts do - configure do - only_when { hostname is :earth } - - file '/etc/hosts.test' do - ensure_line '192.168.1.101 foo' - end - end -end - -desc 'foo' -task :foo do - configure do - file '/tmp/foo.txt' do - ensure_line 'foo bar baz' - end - end -end +task default: :test |
