Sha256: 7c07c9a83b41600f319e19f4a7803570c11325be32f4fd9a68846140ab0a5cea

Contents?: true

Size: 937 Bytes

Versions: 5

Compression:

Stored size: 937 Bytes

Contents

# encoding: utf-8

class Nanoc::GemTest < MiniTest::Unit::TestCase

  include Nanoc::TestHelpers

  def setup
    super
    FileUtils.cd(@orig_wd)
  end

  def test_build
    require 'systemu'

    # Require clean environment
    Dir['nanoc-*.gem'].each { |f| FileUtils.rm(f) }

    # Build
    files_before = Set.new Dir['**/*']
    stdout = ''
    stderr = ''
    status = systemu(
      [ 'gem', 'build', 'nanoc.gemspec' ],
      'stdin'  => '',
      'stdout' => stdout,
      'stderr' => stderr)
    assert status.success?
    files_after = Set.new Dir['**/*']

    # Check new files
    diff = files_after - files_before
    assert_equal 1, diff.size
    assert_match(/^nanoc-.*\.gem$/, diff.to_a[0])

    # Check output
    assert_match(/Successfully built RubyGem\n  Name: nanoc\n  Version: .*\n  File: nanoc-.*\.gem\n/, stdout)
    assert_equal '', stderr
  ensure
    Dir['nanoc-*.gem'].each { |f| FileUtils.rm(f) }
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nanoc-3.6.1 test/test_gem.rb
nanoc-3.6.0 test/test_gem.rb
nanoc-3.5.0 test/test_gem.rb
nanoc-3.5.0b2 test/test_gem.rb
nanoc-3.5.0b1 test/test_gem.rb