redns 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/redns/buffer.rb +1 -1
- data/lib/redns/name.rb +1 -1
- data/lib/redns/question.rb +0 -2
- data/redns.gemspec +1 -1
- data/test/test_redns_name.rb +24 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/lib/redns/buffer.rb
CHANGED
data/lib/redns/name.rb
CHANGED
data/lib/redns/question.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
class ReDNS::Question < ReDNS::Fragment
|
2
2
|
# == Constants ============================================================
|
3
3
|
|
4
|
-
SECTIONS = [ :questions, :answers, :nameservers, :additional_records ]
|
5
|
-
|
6
4
|
# == Attributes ===========================================================
|
7
5
|
|
8
6
|
attribute :name, :class => ReDNS::Name, :default => lambda { ReDNS::Name.new }
|
data/redns.gemspec
CHANGED
data/test/test_redns_name.rb
CHANGED
@@ -81,4 +81,28 @@ class TestReDNSName < Test::Unit::TestCase
|
|
81
81
|
|
82
82
|
assert_equal 0, example_buffer.length
|
83
83
|
end
|
84
|
+
|
85
|
+
def test_double_pointer
|
86
|
+
example_buffer = ReDNS::Buffer.new(
|
87
|
+
[
|
88
|
+
3, ?c, ?o, ?m,
|
89
|
+
192, 6,
|
90
|
+
3, ?n, ?e, ?t,
|
91
|
+
0,
|
92
|
+
7, ?e, ?x, ?a, ?m, ?p, ?l, ?e,
|
93
|
+
192, 0
|
94
|
+
].collect(&:chr).join
|
95
|
+
)
|
96
|
+
|
97
|
+
# Skip past the first "net." / "com." part
|
98
|
+
example_buffer.advance(11)
|
99
|
+
|
100
|
+
name = ReDNS::Name.new(example_buffer)
|
101
|
+
|
102
|
+
assert_equal 'example.com.net.', name.to_s
|
103
|
+
|
104
|
+
assert !name.empty?
|
105
|
+
|
106
|
+
assert_equal 0, example_buffer.length
|
107
|
+
end
|
84
108
|
end
|