hurl 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ require File.dirname(__FILE__) + '/../test_helper.rb'
2
+
3
+ class SessionTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @session = Session.new('sesh')
7
+ end
8
+
9
+ def test_session_should_be_initializable
10
+ assert_equal 'sesh', @session.session
11
+ end
12
+
13
+ def test_should_call_exec_on_session_for_missing_methods
14
+ @session.expects(:hurl).with('glock pop')
15
+ @session.glock 'pop'
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ require File.dirname(__FILE__) + '/../test_helper.rb'
2
+
3
+ class TerminalSessionTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @session = stub("session")
7
+ @terminal = TerminalSession.new(@session)
8
+ end
9
+
10
+ def test_process_should_do_script_with_cmd_in_session
11
+ @session.expects(:do_script).with("hey", :in => @session)
12
+ @terminal.hurl("hey")
13
+ end
14
+ end
@@ -0,0 +1,70 @@
1
+ require File.dirname(__FILE__) + '/../test_helper.rb'
2
+
3
+ class TerminalTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @appscript = stub_everything
7
+ @app = stub(:windows => stub(:[] => @appscript))
8
+ Appscript.stubs(:app).returns(@app)
9
+ end
10
+
11
+ def test_appscript_should_be_Terminal
12
+ Appscript.expects(:app).with('Terminal').returns(@app)
13
+ assert_equal @appscript, Terminal.new('dir').appscript
14
+ end
15
+
16
+ def test_appscript_should_be_window_zero
17
+ windows = mock
18
+ windows.expects(:[]).with(0).returns('window')
19
+ app = stub(:windows => windows)
20
+ Appscript.stubs(:app).with('Terminal').returns(app)
21
+ assert_equal 'window', Terminal.new('dir').appscript
22
+ end
23
+
24
+ def test_project_dir_should_be_initialized
25
+ assert_equal 'dir', Terminal.new('dir').dir
26
+ end
27
+
28
+ def test_create_tab_should_activate_appscript
29
+ t = Terminal.new('dir')
30
+ @appscript.expects(:activate)
31
+ Appscript.stubs(:app).returns(stub_everything)
32
+ t.create_tab
33
+ end
34
+
35
+ def test_create_tab_should_use_system_to_keystroke_t
36
+ t = Terminal.new('dir')
37
+ keystroke = mock
38
+ keystroke.expects(:keystroke).with("t", :using => :command_down)
39
+ Appscript.expects(:app).with('System Events').returns(keystroke)
40
+ t.create_tab
41
+ end
42
+
43
+ def test_this_tab_should_activate_appscript
44
+ t = Terminal.new('dir')
45
+ @appscript.expects(:activate)
46
+ Appscript.stubs(:app).returns(stub_everything)
47
+ t.this_tab
48
+ end
49
+
50
+ def test_create_tab_yields_new_session
51
+ t = Terminal.new('dir')
52
+ keystroke = stub
53
+ keystroke.stubs(:keystroke).with("t", :using => :command_down)
54
+ Appscript.stubs(:app).with('System Events').returns(keystroke)
55
+ @appscript.stubs(:tabs).returns(stub(:last => 'last'))
56
+ TerminalSession.expects(:new).with('last').returns('s')
57
+ t.create_tab do |tab|
58
+ assert_equal 's', tab
59
+ end
60
+ end
61
+
62
+ def test_this_tab_yields_new_session
63
+ t = Terminal.new('dir')
64
+ @appscript.stubs(:tabs).returns(stub(:first => 'last'))
65
+ TerminalSession.expects(:new).with('last').returns('s')
66
+ t.this_tab do |tab|
67
+ assert_equal 's', tab
68
+ end
69
+ end
70
+ end
data/test/hurl_test.rb ADDED
@@ -0,0 +1,4 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ # class HurlTest < Test::Unit::TestCase
4
+ # end
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'mocha'
4
+ require 'appscript'
5
+ require 'hurl'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hurl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Marney
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-25 00:00:00 -04:00
12
+ date: 2008-03-31 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -21,22 +21,58 @@ dependencies:
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.5.1
23
23
  version:
24
- description: Hurl is an ITerm Applescript wrapper built to make scripting in ITerm easy.
24
+ description: rb-appscript wrapper built to assist in scripting terminal events.
25
25
  email: gotascii@gmail.com
26
26
  executables:
27
27
  - hurl
28
28
  extensions: []
29
29
 
30
30
  extra_rdoc_files:
31
- - README
31
+ - History.txt
32
+ - README.txt
33
+ - bin/hurl
32
34
  files:
35
+ - History.txt
36
+ - Manifest.txt
37
+ - README.txt
38
+ - Rakefile
33
39
  - bin/hurl
34
- - README
40
+ - hurls.rb
41
+ - lib/hurl.rb
42
+ - lib/hurl/iterm.rb
43
+ - lib/hurl/iterm_session.rb
44
+ - lib/hurl/project.rb
45
+ - lib/hurl/session.rb
46
+ - lib/hurl/terminal.rb
47
+ - lib/hurl/terminal_session.rb
48
+ - spec/hurl_spec.rb
49
+ - spec/spec_helper.rb
50
+ - tasks/ann.rake
51
+ - tasks/annotations.rake
52
+ - tasks/bones.rake
53
+ - tasks/doc.rake
54
+ - tasks/gem.rake
55
+ - tasks/manifest.rake
56
+ - tasks/post_load.rake
57
+ - tasks/rubyforge.rake
58
+ - tasks/setup.rb
59
+ - tasks/spec.rake
60
+ - tasks/svn.rake
61
+ - tasks/test.rake
62
+ - test/hurl/iterm_session_test.rb
63
+ - test/hurl/iterm_test.rb
64
+ - test/hurl/project_test.rb
65
+ - test/hurl/session_test.rb
66
+ - test/hurl/terminal_session_test.rb
67
+ - test/hurl/terminal_test.rb
68
+ - test/hurl_test.rb
69
+ - test/test_helper.rb
35
70
  has_rdoc: true
36
- homepage: http://gotascii.com
71
+ homepage: http://hurl.rubyforge.org
37
72
  post_install_message:
38
- rdoc_options: []
39
-
73
+ rdoc_options:
74
+ - --main
75
+ - README.txt
40
76
  require_paths:
41
77
  - lib
42
78
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -53,10 +89,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
89
  version:
54
90
  requirements: []
55
91
 
56
- rubyforge_project:
92
+ rubyforge_project: hurl
57
93
  rubygems_version: 1.0.1
58
94
  signing_key:
59
95
  specification_version: 2
60
- summary: ITerm Applescript
61
- test_files: []
62
-
96
+ summary: rb-appscript wrapper built to assist in scripting terminal events
97
+ test_files:
98
+ - test/hurl/iterm_session_test.rb
99
+ - test/hurl/iterm_test.rb
100
+ - test/hurl/project_test.rb
101
+ - test/hurl/session_test.rb
102
+ - test/hurl/terminal_session_test.rb
103
+ - test/hurl/terminal_test.rb
104
+ - test/hurl_test.rb