Sha256: 9f9c7e478c6a210ba55479b3830eaf48c786414b9f18e000f7e92dc315180152

Contents?: true

Size: 656 Bytes

Versions: 31

Compression:

Stored size: 656 Bytes

Contents

require 'kontena/cli/stacks/yaml/validator_v3'
require 'kontena/cli/stacks/yaml/custom_validators/affinities_validator'

describe Kontena::Cli::Stacks::YAML::Validations::CustomValidators::AffinitiesValidator do

  let(:errors) { Hash.new }

  it 'accepts valid affinity' do
    subject.validate('affinity', ['foo==bar'], [], errors)
    expect(errors.size).to eq(0)
  end

  it 'accepts valid soft affinity' do
    subject.validate('affinity', ['foo==~bar'], [], errors)
    expect(errors.size).to eq(0)
  end

  it 'does not accept invalid affinity' do
    subject.validate('affinity', ['foo=bar'], [], errors)
    expect(errors.size).to eq(1)
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
kontena-cli-1.4.0 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.rc2 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.rc1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre14 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre13 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre12 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre11 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre10 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre9 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre8 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.0.pre7 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb