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.5.4 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.4.rc1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.3 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.2 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0.rc1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0.pre5 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0.pre4 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0.pre3 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0.pre2 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.5.0.pre1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.3 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.3.rc1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.2 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.2.rc1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.2.pre1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.1.rc1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb
kontena-cli-1.4.1.pre1 spec/kontena/cli/stacks/yaml/custom_validators/affinities_validator_spec.rb