File: screen.rb

package info (click to toggle)
subtle 0.11.3224-xi-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,600 kB
  • sloc: ansic: 14,699; ruby: 3,101; makefile: 17
file content (74 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# @package test
#
# @file Test Subtlext::Screen functions
# @author Christoph Kappel <unexist@subforge.org>
# @version $Id: test/contexts/screen.rb,v 3169 2012/01/03 20:43:30 unexist $
#
# This program can be distributed under the terms of the GNU GPLv2.
# See the file COPYING for details.
#

context 'Screen' do
  setup do # {{{
    Subtlext::Screen.current
  end # }}}

  asserts 'Check attributes' do # {{{
    0 == topic.id and '0x16+1024+752' == topic.geometry.to_str
  end # }}}

  asserts 'Get list' do # {{{
    list = Subtlext::Screen.list

    list.is_a?(Array) and 1 == list.size and
      Subtlext::Screen.method(:all) == Subtlext::Screen.method(:list)
  end # }}}

  asserts 'Find and compare' do # {{{
    topic == Subtlext::Screen[0]
  end # }}}

  asserts 'Finder' do # {{{
    Subtlext::Screen[0] == Subtlext::Screen.find(
      Subtlext::Geometry.new(100, 100, 100, 100)
    )
  end # }}}

  asserts 'Check current' do # {{{
    topic.current?
  end # }}}

  asserts 'Equal and compare' do # {{{
    topic.eql?(Subtlext::Screen.current) and topic == topic
  end # }}}

  asserts 'Hash and unique' do # {{{
    1 == [ topic, topic ].uniq.size
  end # }}}

  asserts 'Change view' do # {{{
    view1 = topic.view

    sleep 0.5

    topic.view = 'www'

    sleep 0.5

    view2      = topic.view
    topic.view = view1

    sleep 0.5

    view3 = topic.view

    view1 == view3 and 'www' == view2.name
  end # }}}

  asserts 'Convert to string' do # {{{
    '0x16+1024+752' == topic.to_str
  end # }}}
end

# vim:ts=2:bs=2:sw=2:et:fdm=marker