Sha256: 0a966d07483d41ddd41aa0a711e6e6bc90e0ca0c15a6d69ef07cf008fe79bc84
Contents?: true
Size: 950 Bytes
Versions: 16
Compression:
Stored size: 950 Bytes
Contents
require 'spec_helper' describe Dragonfly::Whitelist do it "matches regexps" do whitelist = Dragonfly::Whitelist.new([/platipus/]) whitelist.include?("platipus").should be_truthy whitelist.include?("small platipus in the bath").should be_truthy whitelist.include?("baloney").should be_falsey end it "matches strings" do whitelist = Dragonfly::Whitelist.new(["platipus"]) whitelist.include?("platipus").should be_truthy whitelist.include?("small platipus in the bath").should be_falsey whitelist.include?("baloney").should be_falsey end it "only needs one match" do Dragonfly::Whitelist.new(%w(a b)).include?("c").should be_falsey Dragonfly::Whitelist.new(%w(a b c)).include?("c").should be_truthy end it "allows pushing" do whitelist = Dragonfly::Whitelist.new(["platipus"]) whitelist.push("duck") whitelist.should include "platipus" whitelist.should include "duck" end end
Version data entries
16 entries across 16 versions & 1 rubygems