Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1244 Bytes
1 | #!/usr/local/bin/ruby -w |
2 | |
3 | # tc_import.rb |
4 | # |
5 | # Created by James Edward Gray II on 2005-04-26. |
6 | # Copyright 2005 Gray Productions. All rights reserved. |
7 | # |
8 | # This is Free Software. See LICENSE and COPYING for details. |
9 | |
10 | require "test/unit" |
11 | |
12 | require "highline/import" |
13 | require "stringio" |
14 | |
15 | class TestImport < Test::Unit::TestCase |
16 | def test_import |
17 | assert_respond_to(self, :agree) |
18 | assert_respond_to(self, :ask) |
19 | assert_respond_to(self, :choose) |
20 | assert_respond_to(self, :say) |
21 | end |
22 | |
23 | def test_or_ask |
24 | old_terminal = $terminal |
25 | |
26 | input = StringIO.new |
27 | output = StringIO.new |
28 | $terminal = HighLine.new(input, output) |
29 | |
30 | input << "10\n" |
31 | input.rewind |
32 | |
33 | assert_equal(10, nil.or_ask("How much? ", Integer)) |
34 | |
35 | input.rewind |
36 | |
37 | assert_equal(20, "20".or_ask("How much? ", Integer)) |
38 | assert_equal(20, 20.or_ask("How much? ", Integer)) |
39 | |
40 | assert_equal(10, 20.or_ask("How much? ", Integer) { |q| q.in = 1..10 }) |
41 | ensure |
42 | $terminal = old_terminal |
43 | end |
44 | |
45 | def test_redirection |
46 | old_terminal = $terminal |
47 | |
48 | $terminal = HighLine.new(nil, (output = StringIO.new)) |
49 | say("Testing...") |
50 | assert_equal("Testing...\n", output.string) |
51 | ensure |
52 | $terminal = old_terminal |
53 | end |
54 | end |