Sha256: c080b8c3d8b132beb1f67ff79817804dd4c6b7b826ae54b0108cf96624cabcba

Contents?: true

Size: 982 Bytes

Versions: 1

Compression:

Stored size: 982 Bytes

Contents

require_relative '../helper.rb'

class TestGenerator < Test::Unit::TestCase

  def test_should_be_able_to_build_a_template
    skeleton = File.join(File.dirname(__FILE__), "../fixtures", "template.erb")
    opts = Options.new(%w[ --edge --sqlite --minimal myapp ])
    rails_template = Generator.build_template(opts, skeleton)
    assert_kind_of String, rails_template
    assert_match 'myapp', rails_template
    assert_match 'choosen_adapter = "sqlite"', rails_template
    assert_match 'choosen_plugin_set = "minimal"', rails_template
    assert_match 'ubiquo_branch = nil', rails_template
  end

  def test_should_generate_expected_template_from_custom_profile
    skeleton = File.join(File.dirname(__FILE__), "../fixtures", "template.erb")
    opts = Options.new(%w[ --custom ubiquo_media myapp ])
    rails_template = Generator.build_template(opts, skeleton)
    assert_kind_of String, rails_template
    assert_match 'choosen_plugin_set = "custom"', rails_template
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ubiquo-0.9.0.b9 test/ubiquo/generator_test.rb