Sha256: 9cf7fb2dbf3286fea4c67621ad184049b491dc882191feb3739c0ccb2c242ba3
Contents?: true
Size: 1.18 KB
Versions: 16
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' require 'natives/catalog/validator' describe Natives::Catalog::Validator do describe "#ensure_valid_catalog_groups" do let(:validator) { Natives::Catalog::Validator.new } it "ensures catalog groups is a hash" do expect { validator.ensure_valid_catalog_groups({"rubygems" => {} }) }.not_to raise_error end it "raises error if catalog groups is not a hash" do expect { validator.ensure_valid_catalog_groups([]) }.to raise_error ArgumentError end it "allows catalog groups to be empty" do expect { validator.ensure_valid_catalog_groups({}) }.not_to raise_error end it "ensures each catalog group's value is a hash" do expect { validator.ensure_valid_catalog_groups({"rubygems" => {"a" => "b"} }) }.not_to raise_error end it "raises error if any catalog group's value is not a hash" do expect { validator.ensure_valid_catalog_groups({ "rubygems" => {}, "npm" => nil, "foo" => [] }) }.to raise_error(ArgumentError, "The following catalog group(s) should be a Hash: npm, foo") end end end
Version data entries
16 entries across 16 versions & 2 rubygems