fantasdic r325 - in trunk: . test
- From: mblondel svn gnome org
- To: svn-commits-list gnome org
- Subject: fantasdic r325 - in trunk: . test
- Date: Thu, 21 Aug 2008 15:41:22 +0000 (UTC)
Author: mblondel
Date: Thu Aug 21 15:41:21 2008
New Revision: 325
URL: http://svn.gnome.org/viewvc/fantasdic?rev=325&view=rev
Log:
* test/test_preferences.rb: Added a test for the save! method.
Modified:
trunk/ChangeLog
trunk/test/test_preferences.rb
Modified: trunk/test/test_preferences.rb
==============================================================================
--- trunk/test/test_preferences.rb (original)
+++ trunk/test/test_preferences.rb Thu Aug 21 15:41:21 2008
@@ -22,6 +22,7 @@
$LOAD_PATH.unshift(lib_dir)
require "test/unit"
+require "fileutils"
require "fantasdic"
class TestPreferences < Test::Unit::TestCase
@@ -35,7 +36,6 @@
end
def test_attributes
- require "pp"
assert_equal(@prefs.scan_clipboard, false)
assert_equal(@prefs.window_position, [196, 110])
assert_equal(@prefs.history_nb_rows, 15)
@@ -190,4 +190,19 @@
assert_equal(@prefs.dictionary_exists?("DontExist"), false)
end
+ def test_save
+ begin
+ temp_file = "config_temp.yaml"
+ FileUtils.cp($config_file, temp_file)
+ prefs = Fantasdic::PreferencesBase.new(temp_file)
+ prefs.view_statusbar = false
+ prefs.save!
+
+ prefs2 = Fantasdic::PreferencesBase.new(temp_file)
+ assert_equal(prefs2.view_statusbar, prefs.view_statusbar)
+ ensure
+ FileUtils.rm_f(temp_file)
+ end
+ end
+
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]