From: Cornelius Schumacher
---
docs/api/rest_test | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/docs/api/rest_test b/docs/api/rest_test
index b0f04fb..0ddf6a7 100755
--- a/docs/api/rest_test
+++ b/docs/api/rest_test
@@ -88,10 +88,16 @@ begin
@requests = document.all_children Request
- if ( options.create_template )
- if ( File.exists?( options.testfile ) && !options.force )
- STDERR.puts "Test file '#{options.testfile} already exists." +
- " Use '--force' to overwrite it. Exiting."
+ if ( !File.exists?( options.testfile ) || options.create_template )
+ if ( File.exists?( options.testfile ) )
+ if ( !options.force )
+ STDERR.puts "Test file '#{options.testfile} already exists." +
+ " Use '--force' to overwrite it. Exiting."
+ return
+ end
+ puts "Overwriting test file '#{options.testfile}'."
+ else
+ puts "Creating test file '#{options.testfile}'."
end
File.open( options.testfile, "w" ) do |file|
@requests.each do |r|
--
1.7.7
--
To unsubscribe, e-mail: obs-commits+unsubscribe@opensuse.org
To contact the owner, e-mail: obs-commits+owner@opensuse.org