Sha256: 3471d808c6bc5ebd6ccb445c54a708bb1bdd52ef72e582a1985c5a570a04f1cd

Contents?: true

Size: 887 Bytes

Versions: 10

Compression:

Stored size: 887 Bytes

Contents

require "vagrant-unison/config"

describe VagrantPlugins::Unison::Config do
  let(:instance) { described_class.new }

  describe "defaults" do
    subject do
      instance.tap do |o|
        o.finalize!
      end
    end

    its("host_folder")     { should be_nil }
    its("guest_folder")    { should be_nil }
  end

  describe "overriding defaults" do
    # I typically don't meta-program in tests, but this is a very
    # simple boilerplate test, so I cut corners here. It just sets
    # each of these attributes to "foo" in isolation, and reads the value
    # and asserts the proper result comes back out.
    [:host_folder, :guest_folder].each do |attribute|

      it "should not default #{attribute} if overridden" do
        instance.send("#{attribute}=".to_sym, "foo")
        instance.finalize!
        instance.send(attribute).should == "foo"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vagrant-unison-0.0.9 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.8 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.7 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.6 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.5 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.4 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.3 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.2 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.1 spec/vagrant-unison/config_spec.rb
vagrant-unison-0.0.1.dev spec/vagrant-unison/config_spec.rb