Sha256: 3bfd86ba455d37647c715d0ff037fe2da27739ad586718813065c019692fb8ac

Contents?: true

Size: 982 Bytes

Versions: 32

Compression:

Stored size: 982 Bytes

Contents

require 'spec_helper'

describe Cuboid::State::Options do

    subject { described_class.new }
    let(:dump_directory) do
        "#{Dir.tmpdir}/options-#{Cuboid::Utilities.generate_token}"
    end

    it { is_expected.to respond_to :clear}

    describe '#statistics' do
        let(:statistics) { subject.statistics }
    end

    describe '#dump' do
        it 'stores to disk' do
            Cuboid::Options.datastore.my_custom_option = 'my value'
            subject.dump( dump_directory )

            expect(Cuboid::Options.load( "#{dump_directory}/options" ).
                datastore.my_custom_option).to eq('my value')
        end
    end

    describe '.load' do
        it 'restores from disk' do
            Cuboid::Options.datastore.my_custom_option = 'my value'
            subject.dump( dump_directory )

            described_class.load( dump_directory )

            expect(Cuboid::Options.datastore.my_custom_option).to eq('my value')
        end
    end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cuboid-0.2.11 spec/cuboid/state/options_spec.rb
cuboid-0.2.10 spec/cuboid/state/options_spec.rb
cuboid-0.2.9 spec/cuboid/state/options_spec.rb
cuboid-0.2.8 spec/cuboid/state/options_spec.rb
cuboid-0.2.7 spec/cuboid/state/options_spec.rb
cuboid-0.2.6 spec/cuboid/state/options_spec.rb
cuboid-0.2.5 spec/cuboid/state/options_spec.rb
cuboid-0.2.4.2 spec/cuboid/state/options_spec.rb
cuboid-0.2.4.1 spec/cuboid/state/options_spec.rb
cuboid-0.2.4 spec/cuboid/state/options_spec.rb
cuboid-0.2.3 spec/cuboid/state/options_spec.rb
cuboid-0.2.2 spec/cuboid/state/options_spec.rb
cuboid-0.2.1 spec/cuboid/state/options_spec.rb
cuboid-0.2 spec/cuboid/state/options_spec.rb
cuboid-0.1.9.1 spec/cuboid/state/options_spec.rb
cuboid-0.1.9 spec/cuboid/state/options_spec.rb
cuboid-0.1.8 spec/cuboid/state/options_spec.rb
cuboid-0.1.7 spec/cuboid/state/options_spec.rb
cuboid-0.1.6.1 spec/cuboid/state/options_spec.rb
cuboid-0.1.6 spec/cuboid/state/options_spec.rb