Sha256: 71c81fa4877fe3b1d0c652ed10bba2d0e0b482b5f99f559d21c87e872c928726

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

require "test/helper"
require "test/name_set"

module GGem
  class GGemTest < Test::Unit::TestCase
    include TestBelt

    context "GGem::Gem"
  end

  class RootPathTest < GGemTest
    should "know its root path" do
      assert_equal TMP_PATH, Gem.new(TMP_PATH, 'a-gem').root_path
    end
  end

  class NameTest < GGemTest
    [ GGem::NameSet::Simple,
      GGem::NameSet::Underscored,
      GGem::NameSet::HyphenatedOther
    ].each do |ns|
      should_generate_name_set(ns.new)
    end
  end

  class SaveTest < GGemTest
    NS = GGem::NameSet::Simple.new

    context "after it's been saved"
    setup_once do
      FileUtils.mkdir_p(TMP_PATH)
      Gem.new(TMP_PATH, NS.variations.first).save
    end
    teardown_once do
      FileUtils.rm_rf(TMP_PATH)
    end

    should_create_paths((NS.expected_folders + NS.expected_files).collect do |p|
      File.join(TMP_PATH, NS.name, p)
    end)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ggem-1.0.1 test/gem_test.rb
ggem-1.0.0 test/gem_test.rb