Sha256: a808534571b0516c7604c2e0f4c49ae246a7f02246246a21a8d7b6741edcc85e

Contents?: true

Size: 1.49 KB

Versions: 6

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'

describe 'LadyJosephine::Whitelist' do

  describe 'Whitelist classes' do
    before do
      LadyJosephine::Whitelist.instance.whitelist(Integer)
    end

    it 'should return true for whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?(Integer)).to be_truthy
    end

    it 'should return false for not whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?(Float)).to be_falsy
    end

    it 'should return true for whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?("Integer")).to be_truthy
    end

    it 'should return false for not whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?("Float")).to be_falsy
    end
  end

  describe 'Whitelist string' do
    before do
      LadyJosephine::Whitelist.instance.whitelist("Integer")
    end

    it 'should return true for whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?(Integer)).to be_truthy
    end

    it 'should return false for not whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?(Float)).to be_falsy
    end

    it 'should return true for whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?("Integer")).to be_truthy
    end

    it 'should return false for not whitelisted classes' do
      expect(LadyJosephine::Whitelist.instance.is_whitelisted?("Float")).to be_falsy
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lady_josephine-0.7.0 spec/lib/whitelist_spec.rb
lady_josephine-0.6.3 spec/lib/whitelist_spec.rb
lady_josephine-0.6.2 spec/lib/whitelist_spec.rb
lady_josephine-0.6.1 spec/lib/whitelist_spec.rb
lady_josephine-0.6.0 spec/lib/whitelist_spec.rb
lady_josephine-0.5.0 spec/lib/whitelist_spec.rb