Sha256: 29eb6de35abaf3539c79d1adafc9ba090cb94bdfcb37154cad003fcc06ff8ada

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 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/ricogen"
    @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

4 entries across 4 versions & 2 rubygems

Version Path
patcito-ricogen-0.3 test/hamgen_test.rb
ricogen-0.5 test/hamgen_test.rb
ricogen-0.4 test/hamgen_test.rb
ricogen-0.3 test/hamgen_test.rb