-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71ec038
commit 9960f76
Showing
14 changed files
with
167 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require: rubocop-rspec | ||
|
||
Layout/EmptyLinesAroundAttributeAccessor: | ||
Enabled: true | ||
|
||
|
23 changes: 23 additions & 0 deletions
23
spec/shoulda/matchers/active_model/require_a_valid_domain_name_matcher_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe Shoulda::Matchers::ActiveModel::RequireAValidDomainNameMatcher do | ||
let(:server) { Server.new } | ||
|
||
it 'accepts on domain_name' do | ||
expect(server).to require_a_valid_domain_name(:domain_name) | ||
end | ||
|
||
it 'accepts without a specified attribute' do | ||
expect(server).to require_a_valid_domain_name | ||
end | ||
|
||
it 'rejects on host_name' do | ||
expect(server).not_to require_a_valid_domain_name(:host_name) | ||
end | ||
|
||
it 'has a description message' do | ||
expect(require_a_valid_domain_name.description).to eq('require domain_name to be a valid domain name') | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
spec/shoulda/matchers/active_model/require_a_valid_host_name_matcher_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe Shoulda::Matchers::ActiveModel::RequireAValidHostNameMatcher do | ||
let(:server) { Server.new } | ||
|
||
it 'accepts on host_name' do | ||
expect(server).to require_a_valid_host_name(:host_name) | ||
end | ||
|
||
it 'accepts without a specified attribute' do | ||
expect(server).to require_a_valid_host_name | ||
end | ||
|
||
it 'rejects on domain_name' do | ||
expect(server).not_to require_a_valid_host_name(:domain_name) | ||
end | ||
|
||
it 'has a description message' do | ||
expect(require_a_valid_host_name.description).to eq('require host_name to be a valid host name') | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
spec/shoulda/matchers/active_model/require_a_valid_ip_matcher_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe Shoulda::Matchers::ActiveModel::RequireAValidIpMatcher do | ||
let(:server) { Server.new } | ||
|
||
it 'accepts on ip' do | ||
expect(server).to require_a_valid_ip(:ip) | ||
end | ||
|
||
it 'accepts without a specified attribute' do | ||
expect(server).to require_a_valid_ip | ||
end | ||
|
||
it 'rejects on domain_name' do | ||
expect(server).not_to require_a_valid_ip(:domain_name) | ||
end | ||
|
||
it 'has a description message' do | ||
expect(require_a_valid_ip.description).to eq('require ip to be a valid ip') | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
spec/shoulda/matchers/active_model/require_a_valid_subnet_matcher_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe Shoulda::Matchers::ActiveModel::RequireAValidSubnetMatcher do | ||
let(:subnet) { Subnet.new } | ||
|
||
it 'accepts on value' do | ||
expect(subnet).to require_a_valid_subnet(:value) | ||
end | ||
|
||
it 'accepts without a specified attribute' do | ||
expect(subnet).to require_a_valid_subnet | ||
end | ||
|
||
it 'rejects on id' do | ||
expect(subnet).not_to require_a_valid_subnet(:id) | ||
end | ||
|
||
it 'has a description message' do | ||
expect(require_a_valid_subnet.description).to eq('require value to be a valid subnet') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
spec/validates_host/require_a_valid_domain_name_matcher_spec.rb
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
spec/validates_host/require_a_valid_host_name_matcher_spec.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
spec/validates_host/require_a_valid_subnet_matcher_spec.rb
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.