docheck 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.rdoc +38 -15
- data/data/rdap_dns.json +5354 -0
- data/exe/docheck +6 -0
- data/lib/docheck/application.rb +22 -63
- data/lib/docheck/bootstrap.rb +44 -0
- data/lib/docheck/checker.rb +53 -0
- data/lib/docheck/cli.rb +70 -0
- data/lib/docheck/errors.rb +12 -0
- data/lib/docheck/http_client.rb +77 -0
- data/lib/docheck/name.rb +20 -0
- data/lib/docheck/result.rb +23 -0
- data/lib/docheck/version.rb +3 -1
- data/lib/docheck.rb +17 -5
- metadata +27 -51
- data/.gitignore +0 -3
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -39
- data/Rakefile +0 -2
- data/bin/docheck +0 -3
- data/docheck.gemspec +0 -28
- data/lib/docheck/command.rb +0 -31
- data/test/docheck_test.rb +0 -66
- data/test/helper.rb +0 -7
data/test/docheck_test.rb
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
require File.expand_path('../helper.rb', __FILE__)
|
|
2
|
-
|
|
3
|
-
class TestDocheck < Test::Unit::TestCase
|
|
4
|
-
context "Docheck gem" do
|
|
5
|
-
should "require Whois" do
|
|
6
|
-
assert defined?(Whois)
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
context "Docheck command" do
|
|
11
|
-
setup do
|
|
12
|
-
@docheck_bin = File.expand_path("../../bin/docheck", __FILE__)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
should "shows version" do
|
|
16
|
-
assert_equal "Docheck #{Docheck::VERSION}\n", `ruby #{@docheck_bin} -v`
|
|
17
|
-
assert_equal "Docheck #{Docheck::VERSION}\n", `ruby #{@docheck_bin} --version`
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
should "executes domain name checker correctly" do
|
|
21
|
-
assert `ruby #{@docheck_bin} -n railsmine`
|
|
22
|
-
assert `ruby #{@docheck_bin} --name railsmine`
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
should "prints 'Invalid option'" do
|
|
26
|
-
assert_equal "Invalid option\n", `ruby #{@docheck_bin} -f`
|
|
27
|
-
assert_equal "Invalid option\n", `ruby #{@docheck_bin} --foo`
|
|
28
|
-
assert_equal "Invalid option\n", `ruby #{@docheck_bin} --foo bar`
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
should "prints 'Missing argument'" do
|
|
32
|
-
assert_equal "Missing argument\n", `ruby #{@docheck_bin} -n`
|
|
33
|
-
assert_equal "Missing argument\n", `ruby #{@docheck_bin} --name`
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
context "A Docheck instance" do
|
|
38
|
-
setup do
|
|
39
|
-
@docheck = Docheck::Application.new('railsmine')
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
should "responds to all its public instance method" do
|
|
43
|
-
assert @docheck.respond_to?(:fetch)
|
|
44
|
-
assert @docheck.respond_to?(:print)
|
|
45
|
-
assert @docheck.respond_to?(:available_domains)
|
|
46
|
-
assert @docheck.respond_to?(:registered_domains)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
should "returns all availability and registered domain" do
|
|
50
|
-
result = @docheck.fetch
|
|
51
|
-
assert result.is_a?(Array)
|
|
52
|
-
assert result.first.is_a?(Array)
|
|
53
|
-
assert @docheck.available_domains.is_a?(Array)
|
|
54
|
-
assert_equal result.first, @docheck.available_domains
|
|
55
|
-
assert result.last.is_a?(Array)
|
|
56
|
-
assert @docheck.registered_domains.is_a?(Array)
|
|
57
|
-
assert_equal result.last, @docheck.registered_domains
|
|
58
|
-
assert_not_nil result
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
should "runs #print successfully" do
|
|
62
|
-
assert @docheck.print
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
|