Sha256: 08774c73528f0b3863abfcbe94be9f35e467dd8d9d3c5a3a44136d5c996e734d

Contents?: true

Size: 814 Bytes

Versions: 8

Compression:

Stored size: 814 Bytes

Contents

require 'spec_helper'

class TestImportable
  extend Topographer::Importer::Helpers
end

describe Topographer::Importer::Helpers do
  describe ".boolify" do
    it "returns true if given 'Yes'" do
      expect(TestImportable.boolify('Yes')).to eql true
    end

    it "returns true if given 'True'" do
      expect(TestImportable.boolify('True')).to eql true
    end

    it "returns false if given 'No'" do
      expect(TestImportable.boolify('No')).to eql false
    end

    it "returns false if given 'False'" do
      expect(TestImportable.boolify('False')).to eql false
    end

    it 'returns nil if the type is unknown' do
      expect(TestImportable.boolify('Unknown')).to be_nil
    end

    it 'returns nil if it is given a nil' do
      expect(TestImportable.boolify(nil)).to be_nil
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
topographer-0.0.9 spec/topographer/importer/helpers_spec.rb
topographer-0.0.8 spec/topographer/importer/helpers_spec.rb
topographer-0.0.7 spec/topographer/importer/helpers_spec.rb
topographer-0.0.6 spec/topographer/importer/helpers_spec.rb
topographer-0.0.5 spec/topographer/importer/helpers_spec.rb
topographer-0.0.4 spec/topographer/importer/helpers_spec.rb
topographer-0.0.3 spec/Topographer/importer/helpers_spec.rb
topographer-0.0.2 spec/Cartographer/importer/helpers_spec.rb