|
From: <jh...@us...> - 2012-04-28 01:26:09
|
Revision: 332
http://etch.svn.sourceforge.net/etch/?rev=332&view=rev
Author: jheiss
Date: 2012-04-28 01:26:02 +0000 (Sat, 28 Apr 2012)
Log Message:
-----------
Split the tests up into individual test methods
Modified Paths:
--------------
trunk/test/test_file.rb
Modified: trunk/test/test_file.rb
===================================================================
--- trunk/test/test_file.rb 2012-04-27 02:25:53 UTC (rev 331)
+++ trunk/test/test_file.rb 2012-04-28 01:26:02 UTC (rev 332)
@@ -23,8 +23,7 @@
#puts "Using #{@testroot} as client working directory"
end
- def test_files
-
+ def test_plain
#
# Run a test of basic file creation
#
@@ -59,7 +58,9 @@
correctcontents << sourcecontents
assert_equal(correctcontents, get_file_contents(@targetfile), 'file')
+ end
+ def test_template
#
# Test with a template
#
@@ -95,7 +96,9 @@
correctcontents << sourcecontents
assert_equal(correctcontents, get_file_contents(@targetfile), 'template')
+ end
+ def test_warning
#
# Test using a different warning file
#
@@ -135,7 +138,9 @@
correctcontents << sourcecontents
assert_equal(correctcontents, get_file_contents(@targetfile), 'different warning file')
+ end
+ def test_no_warning
#
# Test using no warning file
#
@@ -164,7 +169,9 @@
# Verify that the file was created properly
assert_equal(sourcecontents, get_file_contents(@targetfile), 'no warning file')
+ end
+ def test_comment_line
#
# Test using a different line comment string
#
@@ -200,7 +207,9 @@
correctcontents << sourcecontents
assert_equal(correctcontents, get_file_contents(@targetfile), 'different line comment')
+ end
+ def test_comment_open_close
#
# Test using comment open/close
#
@@ -239,7 +248,9 @@
correctcontents << sourcecontents
assert_equal(correctcontents, get_file_contents(@targetfile), 'comment open/close')
+ end
+ def test_warning_on_second_line
#
# Test warning on second line
#
@@ -278,7 +289,9 @@
correctcontents << sourcecontents_remainder
assert_equal(correctcontents, get_file_contents(@targetfile), 'warning on second line')
+ end
+ def test_no_space_around_warning
#
# Test no space around warning
#
@@ -298,7 +311,7 @@
EOF
end
- sourcecontents = "This is a test\n"
+ sourcecontents = "Test #{testname}\n"
File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file|
file.write(sourcecontents)
end
@@ -313,7 +326,9 @@
correctcontents << sourcecontents
assert_equal(correctcontents, get_file_contents(@targetfile), 'file')
+ end
+ def test_ownership_and_permissions
#
# Test ownership and permissions
#
@@ -335,6 +350,11 @@
EOF
end
+ sourcecontents = "Test #{testname}\n"
+ File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file|
+ file.write(sourcecontents)
+ end
+
run_etch(@server, @testroot, :testname => testname)
# Verify that the file ownership got set correctly
@@ -370,6 +390,11 @@
EOF
end
+ sourcecontents = "Test #{testname}\n"
+ File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file|
+ file.write(sourcecontents)
+ end
+
run_etch(@server, @testroot, :testname => testname)
# Verify that the ownership defaulted to UID/GID 0
@@ -381,7 +406,9 @@
else
warn "Not running as root, skipping bogus ownership test"
end
-
+ end
+
+ def test_always_manage_metadata
#
# Run a test of always_manage_metadata
#
@@ -413,7 +440,9 @@
# And verify that the file contents didn't change
assert_equal(testcontents, get_file_contents(@targetfile), 'always_manage_metadata contents')
-
+ end
+
+ def test_duplicate_plain
#
# Test duplicate plain instructions
#
@@ -448,7 +477,9 @@
# Verify that the file contents were updated
assert_equal(sourcecontents, get_file_contents(@targetfile), 'duplicate plain instructions')
-
+ end
+
+ def test_contradictory_plain
#
# Test contradictory plain instructions
#
@@ -486,7 +517,9 @@
# Verify that the file contents didn't change
assert_equal(origcontents, get_file_contents(@targetfile), 'contradictory plain instructions')
-
+ end
+
+ def test_duplicate_template
#
# Test duplicate template instructions
#
@@ -521,7 +554,9 @@
# Verify that the file contents were updated
assert_equal(sourcecontents, get_file_contents(@targetfile), 'duplicate template instructions')
-
+ end
+
+ def test_contradictory_template
#
# Test contradictory template instructions
#
@@ -559,7 +594,9 @@
# Verify that the file contents didn't change
assert_equal(origcontents, get_file_contents(@targetfile), 'contradictory template instructions')
-
+ end
+
+ def test_duplicate_script
#
# Test duplicate script instructions
#
@@ -594,7 +631,9 @@
# Verify that the file contents were updated
assert_equal(sourcecontents, get_file_contents(@targetfile), 'duplicate script instructions')
-
+ end
+
+ def test_contradictory_script
#
# Test contradictory script instructions
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|