Sha256: fa51d6e7ea2d6d707ed47b8bf98a9ca20a8b965307f7d719739c8bd78d0e9eb9

Contents?: true

Size: 880 Bytes

Versions: 9

Compression:

Stored size: 880 Bytes

Contents

# frozen_string_literal: true

require "assert"
require "ggem/gem"

class GGem::Gem
  class UnitTests < Assert::Context
    desc "GGem::Gem"
    setup do
      @gem_class = GGem::Gem
    end
  end

  class InitTests < UnitTests
    desc "when init"
    setup do
      @gem_name = Factory.string
      @gem = @gem_class.new(TMP_PATH, @gem_name)
    end
    subject{ @gem }

    should have_readers :root_path, :name
    should have_imeths  :save!, :path, :name=, :module_name, :ruby_name

    should "know its root path and path" do
      assert_equal TMP_PATH, subject.root_path
      assert_equal File.join(TMP_PATH, @gem_name), subject.path
    end

    should "complain if no name is provided" do
      assert_raises(NoNameError) do
        @gem_class.new(TMP_PATH, [nil, ""].sample)
      end
    end

    # most of the gem's behavior is covered in the system tests
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ggem-1.10.6 test/unit/gem_tests.rb
ggem-1.10.5 test/unit/gem_tests.rb
ggem-1.10.4 test/unit/gem_tests.rb
ggem-1.10.3 test/unit/gem_tests.rb
ggem-1.10.2 test/unit/gem_tests.rb
ggem-1.10.1 test/unit/gem_tests.rb
ggem-1.10.0 test/unit/gem_tests.rb
ggem-1.9.5 test/unit/gem_tests.rb
ggem-1.9.4 test/unit/gem_tests.rb