Sha256: 5a67715a6f43463bd0a88b2417f21258574506dca47a3f7c99533894283a2e7d

Contents?: true

Size: 759 Bytes

Versions: 3

Compression:

Stored size: 759 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'colored'
require 'fileutils'

class HamgenTest < Test::Unit::TestCase
  def initialize(arg)
    @path = File.dirname(__FILE__) + '/../'
    @exec = @path + "bin/hamgen"
    @app_name = "test_app"
    @app_path = @path + "test_app"
    super(arg)
  end

  def test_has_rvm_setup
    list = `rvm list`
    assert list.include?("ruby-1.8.7"), "Need rvm with 1.8.7 installed to run tests"
    assert list.include?("ruby-1.9.2"), "Need rvm with 1.9.2 installed to run tests"
  end
  
  def test_runs_generator
    result = build
    assert !result.include?("Error"), "Threw an error"
  end
  
  def build(options = "")
    `#{@exec} #{options} test_app`
  end

  def teardown
    FileUtils.rm_rf(@app_path)
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
ricogen-0.2 test/hamgen_test.rb
ricogen-0.1 test/hamgen_test.rb
hamgen-0.1 test/hamgen_test.rb