htty 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -9
- data/.rspec +2 -1
- data/.travis.yml +11 -8
- data/.yardopts +1 -1
- data/Gemfile +22 -10
- data/Guardfile +31 -13
- data/History.markdown +6 -0
- data/README.markdown +29 -13
- data/Rakefile +2 -64
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/exe/htty +5 -0
- data/htty.gemspec +27 -29
- data/lib/htty.rb +29 -4
- data/lib/htty/cli.rb +9 -16
- data/lib/htty/cli/body_open_command.rb +2 -7
- data/lib/htty/cli/command.rb +10 -18
- data/lib/htty/cli/commands.rb +76 -11
- data/lib/htty/cli/commands/address.rb +1 -14
- data/lib/htty/cli/commands/body_clear.rb +1 -8
- data/lib/htty/cli/commands/body_edit.rb +1 -11
- data/lib/htty/cli/commands/body_request.rb +1 -12
- data/lib/htty/cli/commands/body_request_open.rb +1 -10
- data/lib/htty/cli/commands/body_response.rb +1 -12
- data/lib/htty/cli/commands/body_response_open.rb +1 -11
- data/lib/htty/cli/commands/body_set.rb +1 -10
- data/lib/htty/cli/commands/body_unset.rb +1 -9
- data/lib/htty/cli/commands/cd.rb +1 -8
- data/lib/htty/cli/commands/cookie_add.rb +1 -8
- data/lib/htty/cli/commands/cookie_remove.rb +1 -8
- data/lib/htty/cli/commands/cookies.rb +1 -15
- data/lib/htty/cli/commands/cookies_add.rb +1 -11
- data/lib/htty/cli/commands/cookies_clear.rb +1 -8
- data/lib/htty/cli/commands/cookies_remove.rb +1 -11
- data/lib/htty/cli/commands/cookies_remove_all.rb +1 -11
- data/lib/htty/cli/commands/cookies_use.rb +1 -14
- data/lib/htty/cli/commands/delete.rb +1 -8
- data/lib/htty/cli/commands/exit.rb +1 -8
- data/lib/htty/cli/commands/follow.rb +1 -10
- data/lib/htty/cli/commands/form.rb +1 -7
- data/lib/htty/cli/commands/form_add.rb +1 -7
- data/lib/htty/cli/commands/form_clear.rb +1 -8
- data/lib/htty/cli/commands/form_remove.rb +1 -7
- data/lib/htty/cli/commands/form_remove_all.rb +1 -7
- data/lib/htty/cli/commands/fragment_clear.rb +1 -8
- data/lib/htty/cli/commands/fragment_set.rb +1 -10
- data/lib/htty/cli/commands/fragment_unset.rb +1 -9
- data/lib/htty/cli/commands/get.rb +1 -8
- data/lib/htty/cli/commands/header_set.rb +1 -8
- data/lib/htty/cli/commands/header_unset.rb +1 -8
- data/lib/htty/cli/commands/headers_clear.rb +1 -8
- data/lib/htty/cli/commands/headers_request.rb +1 -15
- data/lib/htty/cli/commands/headers_response.rb +1 -15
- data/lib/htty/cli/commands/headers_set.rb +1 -10
- data/lib/htty/cli/commands/headers_unset.rb +1 -10
- data/lib/htty/cli/commands/headers_unset_all.rb +1 -10
- data/lib/htty/cli/commands/help.rb +4 -12
- data/lib/htty/cli/commands/history.rb +1 -10
- data/lib/htty/cli/commands/history_verbose.rb +1 -12
- data/lib/htty/cli/commands/host_set.rb +1 -8
- data/lib/htty/cli/commands/http_delete.rb +1 -12
- data/lib/htty/cli/commands/http_get.rb +1 -13
- data/lib/htty/cli/commands/http_head.rb +1 -9
- data/lib/htty/cli/commands/http_options.rb +1 -9
- data/lib/htty/cli/commands/http_patch.rb +1 -13
- data/lib/htty/cli/commands/http_post.rb +1 -13
- data/lib/htty/cli/commands/http_put.rb +1 -12
- data/lib/htty/cli/commands/http_trace.rb +1 -9
- data/lib/htty/cli/commands/patch.rb +1 -8
- data/lib/htty/cli/commands/path_set.rb +11 -11
- data/lib/htty/cli/commands/port_set.rb +1 -9
- data/lib/htty/cli/commands/post.rb +1 -8
- data/lib/htty/cli/commands/put.rb +1 -8
- data/lib/htty/cli/commands/query_add.rb +1 -13
- data/lib/htty/cli/commands/query_clear.rb +1 -8
- data/lib/htty/cli/commands/query_remove.rb +1 -13
- data/lib/htty/cli/commands/query_set.rb +1 -13
- data/lib/htty/cli/commands/query_unset.rb +1 -13
- data/lib/htty/cli/commands/query_unset_all.rb +1 -10
- data/lib/htty/cli/commands/quit.rb +1 -7
- data/lib/htty/cli/commands/reuse.rb +5 -12
- data/lib/htty/cli/commands/scheme_set.rb +1 -9
- data/lib/htty/cli/commands/ssl_verification.rb +1 -11
- data/lib/htty/cli/commands/ssl_verification_off.rb +1 -10
- data/lib/htty/cli/commands/ssl_verification_on.rb +1 -10
- data/lib/htty/cli/commands/status.rb +1 -11
- data/lib/htty/cli/commands/undo.rb +1 -7
- data/lib/htty/cli/commands/userinfo_clear.rb +1 -8
- data/lib/htty/cli/commands/userinfo_set.rb +1 -11
- data/lib/htty/cli/commands/userinfo_unset.rb +1 -9
- data/lib/htty/cli/display.rb +4 -6
- data/lib/htty/cli/http_method_command.rb +1 -10
- data/lib/htty/cli/input_device.rb +1 -0
- data/lib/htty/cli/url_escaping.rb +1 -6
- data/lib/htty/cookies_util.rb +3 -3
- data/lib/htty/headers.rb +3 -4
- data/lib/htty/http_patch.rb +20 -23
- data/lib/htty/no_header_error.rb +1 -1
- data/lib/htty/no_location_header_error.rb +1 -3
- data/lib/htty/no_response_error.rb +1 -1
- data/lib/htty/no_set_cookie_header_error.rb +1 -3
- data/lib/htty/payload.rb +1 -5
- data/lib/htty/platform.rb +1 -1
- data/lib/htty/preferences.rb +1 -1
- data/lib/htty/request.rb +3 -13
- data/lib/htty/requests_util.rb +1 -5
- data/lib/htty/response.rb +1 -4
- data/lib/htty/session.rb +1 -3
- data/lib/htty/tempfile_preserving_extname.rb +1 -2
- data/lib/htty/uri.rb +1 -2
- data/lib/htty/version.rb +1 -1
- data/lib/tasks.rb +3 -0
- data/lib/tasks/build_doc.rake +8 -0
- data/lib/tasks/lib_each.rake +25 -0
- data/lib/tasks/spec.rake +68 -0
- data/lib/tasks/spec_each.rake +19 -0
- metadata +48 -209
- data/bin/htty +0 -5
- data/spec/integration/htty/cli/commands/query_add_spec.rb +0 -57
- data/spec/integration/htty/cli/commands/query_remove_spec.rb +0 -55
- data/spec/integration/htty/cli/commands/query_set_spec.rb +0 -78
- data/spec/integration/htty/cli/commands/query_unset_spec.rb +0 -43
- data/spec/spec_helper.rb +0 -76
- data/spec/unit/htty/cli/commands/address_spec.rb +0 -103
- data/spec/unit/htty/cli/commands/body_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/body_edit_spec.rb +0 -18
- data/spec/unit/htty/cli/commands/body_request_spec.rb +0 -67
- data/spec/unit/htty/cli/commands/body_response_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/body_set_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/body_unset_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/cd_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/cookie_add_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/cookie_remove_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/cookies_add_spec.rb +0 -78
- data/spec/unit/htty/cli/commands/cookies_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/cookies_remove_all_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/cookies_remove_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/cookies_spec.rb +0 -76
- data/spec/unit/htty/cli/commands/cookies_use_spec.rb +0 -75
- data/spec/unit/htty/cli/commands/delete_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/exit_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/follow_spec.rb +0 -70
- data/spec/unit/htty/cli/commands/form_add_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/form_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/form_remove_all_spec.rb +0 -66
- data/spec/unit/htty/cli/commands/form_remove_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/form_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/fragment_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/fragment_set_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/fragment_unset_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/get_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/header_set_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/header_unset_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/headers_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/headers_request_spec.rb +0 -81
- data/spec/unit/htty/cli/commands/headers_response_spec.rb +0 -77
- data/spec/unit/htty/cli/commands/headers_set_spec.rb +0 -74
- data/spec/unit/htty/cli/commands/headers_unset_all_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/headers_unset_spec.rb +0 -63
- data/spec/unit/htty/cli/commands/help_spec.rb +0 -67
- data/spec/unit/htty/cli/commands/history_spec.rb +0 -65
- data/spec/unit/htty/cli/commands/history_verbose_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/host_set_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/http_delete_spec.rb +0 -75
- data/spec/unit/htty/cli/commands/http_get_spec.rb +0 -77
- data/spec/unit/htty/cli/commands/http_head_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/http_options_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/http_patch_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/http_post_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/http_put_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/http_trace_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/patch_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/path_set_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/port_set_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/post_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/put_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/query_add_spec.rb +0 -82
- data/spec/unit/htty/cli/commands/query_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/query_remove_spec.rb +0 -82
- data/spec/unit/htty/cli/commands/query_set_spec.rb +0 -82
- data/spec/unit/htty/cli/commands/query_unset_all_spec.rb +0 -74
- data/spec/unit/htty/cli/commands/query_unset_spec.rb +0 -75
- data/spec/unit/htty/cli/commands/quit_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/reuse_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/scheme_set_spec.rb +0 -74
- data/spec/unit/htty/cli/commands/shared_examples_for_commands.rb +0 -55
- data/spec/unit/htty/cli/commands/ssl_verification_off_spec.rb +0 -67
- data/spec/unit/htty/cli/commands/ssl_verification_on_spec.rb +0 -60
- data/spec/unit/htty/cli/commands/ssl_verification_spec.rb +0 -65
- data/spec/unit/htty/cli/commands/status_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/undo_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/userinfo_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/userinfo_set_spec.rb +0 -97
- data/spec/unit/htty/cli/commands/userinfo_unset_spec.rb +0 -72
- data/spec/unit/htty/cli/display_spec.rb +0 -84
- data/spec/unit/htty/cli_spec.rb +0 -28
- data/spec/unit/htty/command.rb +0 -47
- data/spec/unit/htty/headers_spec.rb +0 -40
- data/spec/unit/htty/payload_spec.rb +0 -60
- data/spec/unit/htty/preferences_spec.rb +0 -8
- data/spec/unit/htty/request_follow_spec.rb +0 -94
- data/spec/unit/htty/request_spec.rb +0 -1232
- data/spec/unit/htty/request_userinfo_spec.rb +0 -208
- data/spec/unit/htty/response_spec.rb +0 -0
- data/spec/unit/htty/session_spec.rb +0 -10
- data/spec/unit/htty/shared_examples_for_requests.rb +0 -32
- data/spec/unit/htty/url_escaping.rb +0 -70
- data/spec/unit/htty/version_spec.rb +0 -8
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/address")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/host_set")
|
4
|
-
|
5
|
-
describe HTTY::CLI::Commands::HostSet do
|
6
|
-
describe 'class' do
|
7
|
-
let :klass do
|
8
|
-
subject.class
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should be an alias_for the expected command' do
|
12
|
-
klass.alias_for.should == nil
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should have the expected aliases' do
|
16
|
-
klass.aliases.should == []
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should belong to the expected category' do
|
20
|
-
klass.category.should == 'Navigation'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should have the expected command_line' do
|
24
|
-
klass.command_line.should == 'ho[st-set]'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should have the expected command_line_arguments' do
|
28
|
-
klass.command_line_arguments.should == 'HOST'
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should have the expected help' do
|
32
|
-
klass.help.should == "Changes the host of the request's address"
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should have the expected help_extended' do
|
36
|
-
expected = <<-end_help_extended
|
37
|
-
Changes the host used for the request. Does not communicate with the host.
|
38
|
-
|
39
|
-
The host you supply can be either a hostname (e.g., 'github.com') or an IP address (e.g., '127.0.0.1').
|
40
|
-
|
41
|
-
The console prompt shows the address for the current request.
|
42
|
-
end_help_extended
|
43
|
-
klass.help_extended.should == expected.chomp
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'should have the expected see_also_commands' do
|
47
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::Address]
|
48
|
-
end
|
49
|
-
|
50
|
-
describe 'build_for' do
|
51
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
52
|
-
built = klass.build_for('host-set foo', :session => :the_session)
|
53
|
-
built.should be_instance_of(klass)
|
54
|
-
built.arguments.should == ['foo']
|
55
|
-
built.session.should == :the_session
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
59
|
-
built = klass.build_for('ho bar', :session => :a_session)
|
60
|
-
built.should be_instance_of(klass)
|
61
|
-
built.arguments.should == ['bar']
|
62
|
-
built.session.should == :a_session
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'should correctly handle a command line with a bad command' do
|
66
|
-
built = klass.build_for('x baz', :session => :another_session)
|
67
|
-
built.should == nil
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_delete")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_get")
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_patch")
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_post")
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_put")
|
7
|
-
|
8
|
-
describe HTTY::CLI::Commands::HttpDelete do
|
9
|
-
describe 'class' do
|
10
|
-
let :klass do
|
11
|
-
subject.class
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should be an alias_for the expected command' do
|
15
|
-
klass.alias_for.should == nil
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should have the expected aliases' do
|
19
|
-
klass.aliases.should == [HTTY::CLI::Commands::Delete]
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should belong to the expected category' do
|
23
|
-
klass.category.should == 'Issuing Requests'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should have the expected command_line' do
|
27
|
-
klass.command_line.should == 'http-d[elete]'
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'should have the expected command_line_arguments' do
|
31
|
-
klass.command_line_arguments.should == nil
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should have the expected help' do
|
35
|
-
klass.help.should == 'Issues an HTTP DELETE using the current request'
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should have the expected help_extended' do
|
39
|
-
expected = <<-end_help_extended
|
40
|
-
Issues an HTTP DELETE using the current request.
|
41
|
-
|
42
|
-
Any request body you may set is ignored (i.e., it is not sent as part of the request).
|
43
|
-
end_help_extended
|
44
|
-
klass.help_extended.should == expected.chomp
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'should have the expected see_also_commands' do
|
48
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::HttpGet,
|
49
|
-
HTTY::CLI::Commands::HttpPatch,
|
50
|
-
HTTY::CLI::Commands::HttpPost,
|
51
|
-
HTTY::CLI::Commands::HttpPut]
|
52
|
-
end
|
53
|
-
|
54
|
-
describe 'build_for' do
|
55
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
56
|
-
built = klass.build_for('http-delete', :session => :the_session)
|
57
|
-
built.should be_instance_of(klass)
|
58
|
-
built.arguments.should == []
|
59
|
-
built.session.should == :the_session
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
63
|
-
built = klass.build_for('http-d', :session => :a_session)
|
64
|
-
built.should be_instance_of(klass)
|
65
|
-
built.arguments.should == []
|
66
|
-
built.session.should == :a_session
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'should correctly handle a command line with a bad command' do
|
70
|
-
built = klass.build_for('x', :session => :another_session)
|
71
|
-
built.should == nil
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/follow")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_delete")
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_get")
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_patch")
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_post")
|
7
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_put")
|
8
|
-
|
9
|
-
describe HTTY::CLI::Commands::HttpGet do
|
10
|
-
describe 'class' do
|
11
|
-
let :klass do
|
12
|
-
subject.class
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should be an alias_for the expected command' do
|
16
|
-
klass.alias_for.should == nil
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should have the expected aliases' do
|
20
|
-
klass.aliases.should == [HTTY::CLI::Commands::Get]
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should belong to the expected category' do
|
24
|
-
klass.category.should == 'Issuing Requests'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should have the expected command_line' do
|
28
|
-
klass.command_line.should == 'http-g[et]'
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should have the expected command_line_arguments' do
|
32
|
-
klass.command_line_arguments.should == nil
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should have the expected help' do
|
36
|
-
klass.help.should == 'Issues an HTTP GET using the current request'
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should have the expected help_extended' do
|
40
|
-
expected = <<-end_help_extended
|
41
|
-
Issues an HTTP GET using the current request.
|
42
|
-
|
43
|
-
Any request body you may set is ignored (i.e., it is not sent as part of the request).
|
44
|
-
end_help_extended
|
45
|
-
klass.help_extended.should == expected.chomp
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'should have the expected see_also_commands' do
|
49
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::Follow,
|
50
|
-
HTTY::CLI::Commands::HttpPatch,
|
51
|
-
HTTY::CLI::Commands::HttpPost,
|
52
|
-
HTTY::CLI::Commands::HttpPut,
|
53
|
-
HTTY::CLI::Commands::HttpDelete]
|
54
|
-
end
|
55
|
-
|
56
|
-
describe 'build_for' do
|
57
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
58
|
-
built = klass.build_for('http-get', :session => :the_session)
|
59
|
-
built.should be_instance_of(klass)
|
60
|
-
built.arguments.should == []
|
61
|
-
built.session.should == :the_session
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
65
|
-
built = klass.build_for('http-g', :session => :a_session)
|
66
|
-
built.should be_instance_of(klass)
|
67
|
-
built.arguments.should == []
|
68
|
-
built.session.should == :a_session
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'should correctly handle a command line with a bad command' do
|
72
|
-
built = klass.build_for('x', :session => :another_session)
|
73
|
-
built.should == nil
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_get")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_head")
|
4
|
-
|
5
|
-
describe HTTY::CLI::Commands::HttpHead do
|
6
|
-
describe 'class' do
|
7
|
-
let :klass do
|
8
|
-
subject.class
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should be an alias_for the expected command' do
|
12
|
-
klass.alias_for.should == nil
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should have the expected aliases' do
|
16
|
-
klass.aliases.should == []
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should belong to the expected category' do
|
20
|
-
klass.category.should == 'Issuing Requests'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should have the expected command_line' do
|
24
|
-
klass.command_line.should == 'http-h[ead]'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should have the expected command_line_arguments' do
|
28
|
-
klass.command_line_arguments.should == nil
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should have the expected help' do
|
32
|
-
klass.help.should == 'Issues an HTTP HEAD using the current request'
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should have the expected help_extended' do
|
36
|
-
expected = <<-end_help_extended
|
37
|
-
Issues an HTTP HEAD using the current request.
|
38
|
-
|
39
|
-
Any request body you may set is ignored (i.e., it is not sent as part of the request).
|
40
|
-
end_help_extended
|
41
|
-
klass.help_extended.should == expected.chomp
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should have the expected see_also_commands' do
|
45
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::HttpGet]
|
46
|
-
end
|
47
|
-
|
48
|
-
describe 'build_for' do
|
49
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
50
|
-
built = klass.build_for('http-head', :session => :the_session)
|
51
|
-
built.should be_instance_of(klass)
|
52
|
-
built.arguments.should == []
|
53
|
-
built.session.should == :the_session
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
57
|
-
built = klass.build_for('http-h', :session => :a_session)
|
58
|
-
built.should be_instance_of(klass)
|
59
|
-
built.arguments.should == []
|
60
|
-
built.session.should == :a_session
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'should correctly handle a command line with a bad command' do
|
64
|
-
built = klass.build_for('x', :session => :another_session)
|
65
|
-
built.should == nil
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_get")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_options")
|
4
|
-
|
5
|
-
describe HTTY::CLI::Commands::HttpOptions do
|
6
|
-
describe 'class' do
|
7
|
-
let :klass do
|
8
|
-
subject.class
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should be an alias_for the expected command' do
|
12
|
-
klass.alias_for.should == nil
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should have the expected aliases' do
|
16
|
-
klass.aliases.should == []
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should belong to the expected category' do
|
20
|
-
klass.category.should == 'Issuing Requests'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should have the expected command_line' do
|
24
|
-
klass.command_line.should == 'http-o[ptions]'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should have the expected command_line_arguments' do
|
28
|
-
klass.command_line_arguments.should == nil
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should have the expected help' do
|
32
|
-
klass.help.should == 'Issues an HTTP OPTIONS using the current request'
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should have the expected help_extended' do
|
36
|
-
expected = <<-end_help_extended
|
37
|
-
Issues an HTTP OPTIONS using the current request.
|
38
|
-
|
39
|
-
Any request body you may set is ignored (i.e., it is not sent as part of the request).
|
40
|
-
end_help_extended
|
41
|
-
klass.help_extended.should == expected.chomp
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should have the expected see_also_commands' do
|
45
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::HttpGet]
|
46
|
-
end
|
47
|
-
|
48
|
-
describe 'build_for' do
|
49
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
50
|
-
built = klass.build_for('http-options', :session => :the_session)
|
51
|
-
built.should be_instance_of(klass)
|
52
|
-
built.arguments.should == []
|
53
|
-
built.session.should == :the_session
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
57
|
-
built = klass.build_for('http-o', :session => :a_session)
|
58
|
-
built.should be_instance_of(klass)
|
59
|
-
built.arguments.should == []
|
60
|
-
built.session.should == :a_session
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'should correctly handle a command line with a bad command' do
|
64
|
-
built = klass.build_for('x', :session => :another_session)
|
65
|
-
built.should == nil
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/follow")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_delete")
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_get")
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_patch")
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_post")
|
7
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_put")
|
8
|
-
|
9
|
-
describe HTTY::CLI::Commands::HttpPatch do
|
10
|
-
describe 'class' do
|
11
|
-
let :klass do
|
12
|
-
subject.class
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should be an alias_for the expected command' do
|
16
|
-
klass.alias_for.should == nil
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should have the expected aliases' do
|
20
|
-
klass.aliases.should == [HTTY::CLI::Commands::Patch]
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should belong to the expected category' do
|
24
|
-
klass.category.should == 'Issuing Requests'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should have the expected command_line' do
|
28
|
-
klass.command_line.should == 'http-pa[tch]'
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should have the expected command_line_arguments' do
|
32
|
-
klass.command_line_arguments.should == nil
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should have the expected help' do
|
36
|
-
klass.help.should == 'Issues an HTTP PATCH using the current request'
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should have the expected help_extended' do
|
40
|
-
klass.help_extended.should == 'Issues an HTTP PATCH using the current ' +
|
41
|
-
'request.'
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should have the expected see_also_commands' do
|
45
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::HttpGet,
|
46
|
-
HTTY::CLI::Commands::Follow,
|
47
|
-
HTTY::CLI::Commands::HttpPost,
|
48
|
-
HTTY::CLI::Commands::HttpPut,
|
49
|
-
HTTY::CLI::Commands::HttpDelete]
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'build_for' do
|
53
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
54
|
-
built = klass.build_for('http-patch', :session => :the_session)
|
55
|
-
built.should be_instance_of(klass)
|
56
|
-
built.arguments.should == []
|
57
|
-
built.session.should == :the_session
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
61
|
-
built = klass.build_for('http-pa', :session => :a_session)
|
62
|
-
built.should be_instance_of(klass)
|
63
|
-
built.arguments.should == []
|
64
|
-
built.session.should == :a_session
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'should correctly handle a command line with a bad command' do
|
68
|
-
built = klass.build_for('x', :session => :another_session)
|
69
|
-
built.should == nil
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/follow")
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_delete")
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_get")
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_patch")
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_post")
|
7
|
-
require File.expand_path("#{File.dirname __FILE__}/../../../../../lib/htty/cli/commands/http_put")
|
8
|
-
|
9
|
-
describe HTTY::CLI::Commands::HttpPost do
|
10
|
-
describe 'class' do
|
11
|
-
let :klass do
|
12
|
-
subject.class
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should be an alias_for the expected command' do
|
16
|
-
klass.alias_for.should == nil
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should have the expected aliases' do
|
20
|
-
klass.aliases.should == [HTTY::CLI::Commands::Post]
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should belong to the expected category' do
|
24
|
-
klass.category.should == 'Issuing Requests'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should have the expected command_line' do
|
28
|
-
klass.command_line.should == 'http-po[st]'
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should have the expected command_line_arguments' do
|
32
|
-
klass.command_line_arguments.should == nil
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should have the expected help' do
|
36
|
-
klass.help.should == 'Issues an HTTP POST using the current request'
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should have the expected help_extended' do
|
40
|
-
klass.help_extended.should == 'Issues an HTTP POST using the current ' +
|
41
|
-
'request.'
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should have the expected see_also_commands' do
|
45
|
-
klass.see_also_commands.should == [HTTY::CLI::Commands::HttpGet,
|
46
|
-
HTTY::CLI::Commands::Follow,
|
47
|
-
HTTY::CLI::Commands::HttpPatch,
|
48
|
-
HTTY::CLI::Commands::HttpPut,
|
49
|
-
HTTY::CLI::Commands::HttpDelete]
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'build_for' do
|
53
|
-
it 'should correctly handle a valid, unabbreviated command line' do
|
54
|
-
built = klass.build_for('http-post', :session => :the_session)
|
55
|
-
built.should be_instance_of(klass)
|
56
|
-
built.arguments.should == []
|
57
|
-
built.session.should == :the_session
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'should correctly handle a valid, abbreviated command line' do
|
61
|
-
built = klass.build_for('http-po', :session => :a_session)
|
62
|
-
built.should be_instance_of(klass)
|
63
|
-
built.arguments.should == []
|
64
|
-
built.session.should == :a_session
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'should correctly handle a command line with a bad command' do
|
68
|
-
built = klass.build_for('x', :session => :another_session)
|
69
|
-
built.should == nil
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|