Sha256: bd14b3c70ba9bd160c50a36f242cd8baae2435926ae8319267516d8e666fc796
Contents?: true
Size: 803 Bytes
Versions: 7
Compression:
Stored size: 803 Bytes
Contents
# frozen_string_literal: true RSpec.describe Necromancer, 'config' do it "configures global settings per instance" do converter = described_class.new converter.configure do |config| config.strict false end expect(converter.convert("1.2.3").to(:array)).to eq(["1.2.3"]) converter.configure do |config| config.strict true end expect { converter.convert("1.2.3").to(:array) }.to raise_error(Necromancer::ConversionTypeError) end it "configures global settings through instance block" do converter = described_class.new do |config| config.strict true end expect(converter.configuration.strict).to eq(true) expect { converter.convert("1.2.3").to(:array) }.to raise_error(Necromancer::ConversionTypeError) end end
Version data entries
7 entries across 7 versions & 2 rubygems