Sha256: 25ba5a5ab89f51efa2aa814e86ba10b3ee71f2c5d573a5fdc3f3f2e95980289a

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

# encoding: utf-8

describe "Blacklist" do

  it "works with array" do
    selector = Selector.new except: [:foo, :qux]

    expect(selector[:foo]).to eql(false)
    expect(selector[:bar]).to eql(true)
  end

  it "works with regexp" do
    selector = Selector.new except: /foo/

    expect(selector[:foobar]).to eql(false)
    expect(selector[:bar]).to eql(true)
  end

  it "works with range" do
    selector = Selector.new except: 1..3

    expect(selector[2.4]).to eql(false)
    expect(selector[0]).to eql(true)
  end

  it "works with proc" do
    selector = Selector.new except: -> value { value.is_a? Hash }

    expect(selector[foo: :FOO]).to eql(false)
    expect(selector[:foo]).to eql(true)
  end

end # describe Whitelist

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
selector-0.0.3 spec/integration/blacklist_spec.rb
selector-0.0.2 spec/integration/blacklist_spec.rb
selector-0.0.1 spec/integration/blacklist_spec.rb