rspec-dns 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +1 -2
- data/README.markdown +14 -0
- data/lib/rspec-dns/have_dns.rb +9 -5
- data/rspec-dns.gemspec +1 -1
- metadata +11 -23
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5905467493cce46eda41b6a58a098c9b5c377b31
|
4
|
+
data.tar.gz: 888100c7a3e9a56c347839ec964313de14cfccdc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 629eb5acb5d76c1b527529d2b7cda36bd8d614ce13126a64caa685f70a46743350a8588daad4654ebdf4eb73de72edb54e2d13b2e9be2b57d331f50b4fe8145d
|
7
|
+
data.tar.gz: f5c2f41d281f9c556e5893d72f4f263a44ed88ec888014898c5a352aa96959d3eb9af6354315fbfd38ea587a27936b02b0fdbf0988b3a37a66042076b432ef2e
|
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -87,6 +87,20 @@ Failure/Error: it { should have_dns.with_type('TXT').and_ftl(300).and_data('a=b'
|
|
87
87
|
|
88
88
|
For this reason, you should always check the `type` attribute first in your chain.
|
89
89
|
|
90
|
+
Configuring
|
91
|
+
-----------
|
92
|
+
All configurations must be in your project root at `config/dns.yml`. This YAML file directly corresponds to the Resolv DNS initializer.
|
93
|
+
|
94
|
+
For example, to directly query your DNS servers (necessary for correct TTL tests), create a `config/dns.yml` file like this:
|
95
|
+
|
96
|
+
```yaml
|
97
|
+
nameserver:
|
98
|
+
- 1.2.3.5
|
99
|
+
- 6.7.8.9
|
100
|
+
```
|
101
|
+
|
102
|
+
The full list of configuration options can be found on the [Resolv docs](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/resolv/rdoc/index.html).
|
103
|
+
|
90
104
|
Contributing
|
91
105
|
------------
|
92
106
|
1. Fork the project on github
|
data/lib/rspec-dns/have_dns.rb
CHANGED
@@ -6,11 +6,15 @@ RSpec::Matchers.define :have_dns do
|
|
6
6
|
|
7
7
|
_records.any? do |record|
|
8
8
|
_options.all? do |option, value|
|
9
|
-
#
|
10
|
-
if option == :
|
11
|
-
record.
|
9
|
+
# To distinguish types because not all Resolv returns have type
|
10
|
+
if option == :type
|
11
|
+
record.class.name.split('::').last == value.to_s
|
12
12
|
else
|
13
|
-
|
13
|
+
if value.is_a? String
|
14
|
+
record.send(option).to_s == value
|
15
|
+
else
|
16
|
+
record.send(option) == value
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -25,7 +29,7 @@ RSpec::Matchers.define :have_dns do
|
|
25
29
|
end
|
26
30
|
|
27
31
|
description do
|
28
|
-
|
32
|
+
"have the correct dns entries with #{_options}"
|
29
33
|
end
|
30
34
|
|
31
35
|
def method_missing(m, *args, &block)
|
data/rspec-dns.gemspec
CHANGED
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Seth Vargo
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-08-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '2.9'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '2.9'
|
46
41
|
description: Easily test your DNS entries with RSpec
|
@@ -60,33 +55,26 @@ files:
|
|
60
55
|
- rspec-dns.gemspec
|
61
56
|
homepage: https://github.com/customink/rspec-dns
|
62
57
|
licenses: []
|
58
|
+
metadata: {}
|
63
59
|
post_install_message:
|
64
60
|
rdoc_options: []
|
65
61
|
require_paths:
|
66
62
|
- lib
|
67
63
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
64
|
requirements:
|
70
|
-
- -
|
65
|
+
- - '>='
|
71
66
|
- !ruby/object:Gem::Version
|
72
67
|
version: '0'
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
hash: -1474966448062495488
|
76
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
69
|
requirements:
|
79
|
-
- -
|
70
|
+
- - '>='
|
80
71
|
- !ruby/object:Gem::Version
|
81
72
|
version: '0'
|
82
|
-
segments:
|
83
|
-
- 0
|
84
|
-
hash: -1474966448062495488
|
85
73
|
requirements: []
|
86
74
|
rubyforge_project:
|
87
|
-
rubygems_version:
|
75
|
+
rubygems_version: 2.0.3
|
88
76
|
signing_key:
|
89
|
-
specification_version:
|
77
|
+
specification_version: 4
|
90
78
|
summary: rspec-dns provides an easy-to-use DSL for testing your DNS records are responding
|
91
79
|
as they should.
|
92
80
|
test_files: []
|