zerenity 1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/CHANGELOG +21 -0
  2. data/README +63 -0
  3. data/examples/example_calendar.rb +6 -0
  4. data/examples/example_colorselection.rb +5 -0
  5. data/examples/example_entry.rb +16 -0
  6. data/examples/example_error.rb +3 -0
  7. data/examples/example_fileselection.rb +26 -0
  8. data/examples/example_info.rb +3 -0
  9. data/examples/example_list.rb +10 -0
  10. data/examples/example_progress.rb +40 -0
  11. data/examples/example_question.rb +4 -0
  12. data/examples/example_textinfo.rb +11 -0
  13. data/examples/example_warning.rb +3 -0
  14. data/lib/zerenity.rb +14 -0
  15. data/lib/zerenity/base.rb +50 -0
  16. data/lib/zerenity/calendar.rb +26 -0
  17. data/lib/zerenity/colorselection.rb +30 -0
  18. data/lib/zerenity/entry.rb +36 -0
  19. data/lib/zerenity/error.rb +17 -0
  20. data/lib/zerenity/fileselection.rb +68 -0
  21. data/lib/zerenity/info.rb +18 -0
  22. data/lib/zerenity/list.rb +110 -0
  23. data/lib/zerenity/messagedialog.rb +34 -0
  24. data/lib/zerenity/progress.rb +136 -0
  25. data/lib/zerenity/progress.rb~ +136 -0
  26. data/lib/zerenity/question.rb +26 -0
  27. data/lib/zerenity/scale.rb +41 -0
  28. data/lib/zerenity/textinfo.rb +49 -0
  29. data/lib/zerenity/warning.rb +18 -0
  30. data/test/all.rb +2 -0
  31. data/test/tc_base.rb +35 -0
  32. data/test/tc_calendar.rb +28 -0
  33. data/test/tc_entry.rb +49 -0
  34. data/test/tc_fileselection.rb +37 -0
  35. data/test/tc_info.rb +16 -0
  36. data/test/tc_list.rb +138 -0
  37. data/test/tc_messagedialog.rb +16 -0
  38. data/test/tc_progress.rb +76 -0
  39. data/test/tc_question.rb +23 -0
  40. data/test/tc_scale.rb +33 -0
  41. data/test/tc_textinfo.rb +33 -0
  42. data/test/tc_warning.rb +16 -0
  43. data/test/ts_zerenity.rb +33 -0
  44. metadata +97 -0
@@ -0,0 +1,23 @@
1
+ require('test/unit')
2
+ require('gtk2')
3
+ require('zerenity/question')
4
+
5
+ class TC_Question < Test::Unit::TestCase
6
+ def setup
7
+ Gtk.init
8
+ @options = {:text=>"Do you wish to continue"}
9
+ @dialog = Gtk::Dialog.new
10
+ end
11
+
12
+ def test_check
13
+ Zerenity::Question.check(@options)
14
+ assert_equal("Do you wish to continue",@options[:text])
15
+ assert_equal(Gtk::MessageDialog::QUESTION,@options[:type])
16
+ end
17
+
18
+ def test_build_normal
19
+ Zerenity::Question.build(@dialog,@options)
20
+ assert_equal(Gtk::Button,@options[:cancel_button].class)
21
+ assert(@options[:cancel_button].use_stock?)
22
+ end
23
+ end
@@ -0,0 +1,33 @@
1
+ require('test/unit')
2
+ require('gtk2')
3
+ require('zerenity/scale')
4
+
5
+ class TC_Scale < Test::Unit::TestCase
6
+ def setup
7
+ Gtk.init
8
+ @options = {}
9
+ @dialog = Gtk::Dialog.new
10
+ end
11
+
12
+ def test_check_normal
13
+ assert_nothing_raised{Zerenity::Scale.check(@options)}
14
+ assert_equal(0,@options[:initial])
15
+ assert_equal(0,@options[:min])
16
+ assert_equal(1,@options[:step])
17
+ assert_equal(100,@options[:max])
18
+ end
19
+
20
+ def test_build_normal
21
+ Zerenity::Scale.check(@options)
22
+ Zerenity::Scale.build(@dialog,@options)
23
+ assert_equal(Gtk::Label,@dialog.vbox.children[0].class)
24
+ assert_equal(Gtk::HScale,@dialog.vbox.children[1].class)
25
+ end
26
+
27
+ def test_retrieve_selection_normal
28
+ Zerenity::Scale.check(@options)
29
+ Zerenity::Scale.build(@dialog,@options)
30
+ @dialog.vbox.children[1].value = 20
31
+ assert_equal(20,Zerenity::Scale.retrieve_selection(@dialog,@options))
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ require('test/unit')
2
+ require('gtk2')
3
+ require('zerenity/textinfo')
4
+
5
+ class TC_TextInfo < Test::Unit::TestCase
6
+ def setup
7
+ Gtk.init #Prevents segmentation fault
8
+ @options = {}
9
+ @dialog = Gtk::Dialog.new
10
+ end
11
+
12
+ def test_check_normal
13
+ Zerenity::TextInfo.check(@options)
14
+ assert_equal(false,@options[:editable])
15
+ assert_equal(false,@options[:scrollable])
16
+ assert_equal(-1,@options[:width])
17
+ assert_equal(-1,@options[:height])
18
+ assert_equal("",@options[:text])
19
+ end
20
+
21
+ def test_build_normal
22
+ Zerenity::TextInfo.build(@dialog,@options)
23
+ assert_equal(Gtk::ScrolledWindow,@dialog.vbox.children[0].class)
24
+ assert_equal(Gtk::TextView,@dialog.vbox.children[0].children[0].class)
25
+ assert_equal(false,@dialog.vbox.children[0].children[0].editable?)
26
+ end
27
+
28
+ def test_retrieve_selection
29
+ @options[:text]="This is some\ntext"
30
+ Zerenity::TextInfo.build(@dialog,@options)
31
+ assert_equal("This is some\ntext",Zerenity::TextInfo.retrieve_selection(@dialog,@options))
32
+ end
33
+ end
@@ -0,0 +1,16 @@
1
+ require('test/unit')
2
+ require('gtk2')
3
+ require('zerenity/warning')
4
+
5
+ class TC_Waring < Test::Unit::TestCase
6
+ def setup
7
+ Gtk.init
8
+ @options={}
9
+ @dialog = Gtk::Dialog.new
10
+ end
11
+
12
+ def test_build_normal
13
+ Zerenity::Warning.check(@options)
14
+ assert_equal(Gtk::MessageDialog::WARNING,@options[:type])
15
+ end
16
+ end
@@ -0,0 +1,33 @@
1
+ require ('test/unit')
2
+ require('test/tc_list')
3
+ require('test/tc_progress')
4
+ require('test/tc_question')
5
+ require('test/tc_textinfo')
6
+ require('test/tc_entry')
7
+ require('test/tc_base')
8
+ require('test/tc_calendar')
9
+ require('test/tc_fileselection')
10
+ require('test/tc_info')
11
+ require('test/tc_messagedialog')
12
+ require('test/tc_scale')
13
+ require('test/tc_warning')
14
+
15
+ class TS_Zerenity < Test::Unit::TestSuite
16
+ def initialize(name="Zerenity Test Suite")
17
+ super(name)
18
+ @tests << TC_List.suite
19
+ @tests << TC_Progress.suite
20
+ @tests << TC_Question.suite
21
+ @tests << TC_TextInfo.suite
22
+ @tests << TC_Entry.suite
23
+ @tests << TC_Base.suite
24
+ @tests << TC_Calender.suite
25
+ @tests << TC_Error.suite
26
+ @tests << Tc_FileSelection.suite
27
+ @tests << TC_Info.suite
28
+ @tests << TC_MessageDialog.suite
29
+ @tests << TC_Progress.suite
30
+ @tests << TC_Warning.suite
31
+ @tests << TC_Scale.suite
32
+ end
33
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zerenity
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.3"
5
+ platform: ruby
6
+ authors:
7
+ - Farrel Lifson
8
+ autorequire: zerenity
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-16 00:00:00 +00:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: farrel.lifson@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ - CHANGELOG
25
+ files:
26
+ - lib/zerenity.rb
27
+ - lib/zerenity
28
+ - lib/zerenity/progress.rb
29
+ - lib/zerenity/info.rb
30
+ - lib/zerenity/question.rb
31
+ - lib/zerenity/error.rb
32
+ - lib/zerenity/entry.rb
33
+ - lib/zerenity/messagedialog.rb
34
+ - lib/zerenity/warning.rb
35
+ - lib/zerenity/fileselection.rb
36
+ - lib/zerenity/progress.rb~
37
+ - lib/zerenity/textinfo.rb
38
+ - lib/zerenity/calendar.rb
39
+ - lib/zerenity/scale.rb
40
+ - lib/zerenity/colorselection.rb
41
+ - lib/zerenity/list.rb
42
+ - lib/zerenity/base.rb
43
+ - examples/example_fileselection.rb
44
+ - examples/example_progress.rb
45
+ - examples/example_calendar.rb
46
+ - examples/example_error.rb
47
+ - examples/example_textinfo.rb
48
+ - examples/example_warning.rb
49
+ - examples/example_question.rb
50
+ - examples/example_colorselection.rb
51
+ - examples/example_entry.rb
52
+ - examples/example_info.rb
53
+ - examples/example_list.rb
54
+ - test/tc_info.rb
55
+ - test/all.rb
56
+ - test/tc_fileselection.rb
57
+ - test/tc_messagedialog.rb
58
+ - test/tc_list.rb
59
+ - test/ts_zerenity.rb
60
+ - test/tc_warning.rb
61
+ - test/tc_entry.rb
62
+ - test/tc_scale.rb
63
+ - test/tc_base.rb
64
+ - test/tc_question.rb
65
+ - test/tc_calendar.rb
66
+ - test/tc_textinfo.rb
67
+ - test/tc_progress.rb
68
+ - README
69
+ - CHANGELOG
70
+ has_rdoc: true
71
+ homepage: http://www.aimred.com/projects/zerenity
72
+ post_install_message:
73
+ rdoc_options: []
74
+
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: "0"
82
+ version:
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: "0"
88
+ version:
89
+ requirements: []
90
+
91
+ rubyforge_project:
92
+ rubygems_version: 1.3.1
93
+ signing_key:
94
+ specification_version: 2
95
+ summary: A Zenity clone for Ruby
96
+ test_files: []
97
+