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:
- 1624 Bytes
1 | #!/usr/local/bin/ruby -w |
2 | |
3 | # tc_color_scheme.rb |
4 | # |
5 | # Created by Jeremy Hinegardner on 2007-01-24. |
6 | # Copyright 2007 Jeremy Hinegardner. All rights reserved. |
7 | # |
8 | # This is Free Software. See LICENSE and COPYING for details. |
9 | |
10 | require "test/unit" |
11 | |
12 | require "highline" |
13 | require "stringio" |
14 | |
15 | class TestColorScheme < Test::Unit::TestCase |
16 | def setup |
17 | @input = StringIO.new |
18 | @output = StringIO.new |
19 | @terminal = HighLine.new(@input, @output) |
20 | |
21 | @old_color_scheme = HighLine.color_scheme |
22 | end |
23 | |
24 | def teardown |
25 | HighLine.color_scheme = @old_color_scheme |
26 | end |
27 | |
28 | def test_using_color_scheme |
29 | assert_equal(false,HighLine.using_color_scheme?) |
30 | |
31 | HighLine.color_scheme = HighLine::ColorScheme.new |
32 | assert_equal(true,HighLine.using_color_scheme?) |
33 | end |
34 | |
35 | def test_scheme |
36 | HighLine.color_scheme = HighLine::SampleColorScheme.new |
37 | |
38 | @terminal.say("This should be <%= color('warning yellow', :warning) %>.") |
39 | assert_equal("This should be \e[1m\e[33mwarning yellow\e[0m.\n",@output.string) |
40 | @output.rewind |
41 | |
42 | @terminal.say("This should be <%= color('warning yellow', 'warning') %>.") |
43 | assert_equal("This should be \e[1m\e[33mwarning yellow\e[0m.\n",@output.string) |
44 | @output.rewind |
45 | |
46 | @terminal.say("This should be <%= color('warning yellow', 'WarNing') %>.") |
47 | assert_equal("This should be \e[1m\e[33mwarning yellow\e[0m.\n",@output.string) |
48 | @output.rewind |
49 | |
50 | # turn it back off, should raise an exception |
51 | HighLine.color_scheme = @old_color_scheme |
52 | assert_raises(NameError) { |
53 | @terminal.say("This should be <%= color('nothing at all', :error) %>.") |
54 | } |
55 | end |
56 | end |