Sha256: d10b2d516219774a6051b83d6079f4e1b6f954533665846e5b816b52594d990d

Contents?: true

Size: 1.14 KB

Versions: 8

Compression:

Stored size: 1.14 KB

Contents

require 'vagrant-vmpooler/config'
require 'rspec/its'

RSpec.configure do |config|
  # ...
  config.mock_with :rspec do |c|
    c.syntax = [:should, :expect]
  end
  config.expect_with :rspec do |c|
    c.syntax = [:should, :expect]
  end
end

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

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

    its("os") {should be_nil}
    its("verbose") {should be false}
    its("password") {should be_nil}
    its("ttl") {should be_nil}
    its("disk") {should be_nil}
  end

  describe "overriding defaults" do
      [:os, :verbose, :password, :ttl, :disk].each do |attribute|
        it "should not default #{attribute} if overridden" do
          # but these should always come together, so you need to set them all or nothing
          instance.send("url=".to_sym, "foo")
          instance.send("token=".to_sym, "foo")
          instance.send("os=".to_sym, "foo")
          instance.send("#{attribute}=".to_sym, "foo")
          instance.finalize!
          instance.send(attribute).should == "foo"
        end
      end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-vmpooler-0.2.0 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.9 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.8 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.7 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.6 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.5 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.4 spec/vagrant-vmpooler/config_spec.rb
vagrant-vmpooler-0.1.2 spec/vagrant-vmpooler/config_spec.rb