Sha256: f0428cb19a86ba64e89c08fa12315b93f68ad952c993c3817bfa26b030479ad2

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

require 'assert'

require 'cap-util/server_roles_yaml'

module CapUtil

  class ServerRolesYamlTests < Assert::Context
    desc "the ServerRolesYaml util"
    setup do
      @roles_yaml = ServerRolesYaml.new(FakeCap.new )
    end
    subject { @roles_yaml }

    should have_imeths :get, :validate, :valid?, :read
    should have_reader :desc, :source

    should "default the yaml's desc and source" do
      assert_equal "server roles", subject.desc
      assert_equal "", subject.source
    end

    should "use a custom desc and source if given" do
      yml = ServerRolesYaml.new(FakeCap.new, {
        :desc => 'staging',
        :source => 'the place'
      })
      assert_equal "staging server roles", yml.desc
      assert_equal " from the place", yml.source
    end

    should "raise appropriate NotImplementedErrors" do
      assert_raises(NotImplementedError) { subject.validate }
      assert_raises(NotImplementedError) { subject.valid? }
      assert_raises(NotImplementedError) { subject.read }
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cap-util-1.1.0 test/server_roles_yaml_tests.rb
cap-util-1.0.1 test/server_roles_yaml_tests.rb
cap-util-1.0.0 test/server_roles_yaml_tests.rb
cap-util-1.0.0.rc1 test/server_roles_yaml_tests.rb
cap-util-0.4.0 test/server_roles_yaml_tests.rb