Skip to content

Commit

Permalink
Merge pull request #129 from mocktools/develop
Browse files Browse the repository at this point in the history
Ruby DnsMock v1.6.1
  • Loading branch information
bestwebua authored Jan 7, 2024
2 parents e04f255 + 6b91349 commit 07cf4bb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .circleci/gemspecs/latest
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler-audit', '~> 0.9.1'
spec.add_development_dependency 'fasterer', '~> 0.11.0'
spec.add_development_dependency 'ffaker', '~> 2.23'
spec.add_development_dependency 'net-ftp', '~> 0.3.3'
spec.add_development_dependency 'net-ftp', '~> 0.3.4'
spec.add_development_dependency 'pry-byebug', '~> 3.10', '>= 3.10.1'
spec.add_development_dependency 'rake', '~> 13.1'
spec.add_development_dependency 'reek', '~> 6.2'
spec.add_development_dependency 'rspec', '~> 3.12'
spec.add_development_dependency 'rspec-dns', '~> 0.1.8'
spec.add_development_dependency 'rubocop', '~> 1.59'
spec.add_development_dependency 'rubocop-performance', '~> 1.20', '>= 1.20.1'
spec.add_development_dependency 'rubocop-rspec', '~> 2.25'
spec.add_development_dependency 'rubocop-rspec', '~> 2.26', '>= 2.26.1'
spec.add_development_dependency 'simplecov', '~> 0.22.0'
end
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.1] - 2024-01-07

### Updated

- Updated gemspecs
- Updated gem version
- Updated gem documentation

## [1.6.0] - 2024-01-05

### Added
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

## Features

- Ability to mimic any DNS records (`A`, `AAAA`, `CNAME`, `MX`, `NS`, `PTR`, `SOA` and `TXT`)
- Ability to mimic any DNS records (`A`, `AAAA`, `CNAME`, `MX`, `NS`, `PTR`, `SOA`, `SRV` and `TXT`)
- Automatically converts host names to RDNS/[Punycode](https://en.wikipedia.org/wiki/Punycode) representation
- Lightweight UDP DNS mock server with dynamic/manual port assignment
- Test framework agnostic (it's PORO, so you can use it outside of `RSpec`, `Test::Unit` or `MiniTest`)
Expand Down Expand Up @@ -66,6 +66,7 @@ gem install dns_mock

```ruby
# Example of mocked DNS records, please follow this data structure

records = {
'example.com' => {
a: %w[1.1.1.1 2.2.2.2],
Expand Down Expand Up @@ -137,6 +138,7 @@ Require this either in your Gemfile or in RSpec's support scripts. So either:

```ruby
# Gemfile

group :test do
gem 'rspec'
gem 'dns_mock', require: 'dns_mock/test_framework/rspec'
Expand All @@ -147,6 +149,7 @@ or

```ruby
# spec/support/config/dns_mock.rb

require 'dns_mock/test_framework/rspec'
```

Expand All @@ -156,13 +159,15 @@ Just add `DnsMock::TestFramework::RSpec::Helper` if you wanna use shortcut `dns_

```ruby
# spec/support/config/dns_mock.rb

RSpec.configure do |config|
config.include DnsMock::TestFramework::RSpec::Helper
end
```

```ruby
# your awesome first_a_record_spec.rb
# Your awesome first_a_record_spec.rb

RSpec.describe FirstARecord do
subject(:service) do
described_class.call(
Expand Down
2 changes: 1 addition & 1 deletion dns_mock.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'simpleidn', '~> 0.2.1'

spec.add_development_dependency 'ffaker', ffaker_version
spec.add_development_dependency 'net-ftp', '~> 0.3.3' if current_ruby_version >= ::Gem::Version.new('3.1.0')
spec.add_development_dependency 'net-ftp', '~> 0.3.4' if current_ruby_version >= ::Gem::Version.new('3.1.0')
spec.add_development_dependency 'rake', '~> 13.1'
spec.add_development_dependency 'rspec', '~> 3.12'
spec.add_development_dependency 'rspec-dns', '~> 0.1.8'
Expand Down
2 changes: 1 addition & 1 deletion lib/dns_mock/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module DnsMock
VERSION = '1.6.0'
VERSION = '1.6.1'
end

0 comments on commit 07cf4bb

Please sign in to comment.