Sha256: 8a758385ad1992e57ccb3fba62126526a6ab8f2bd201b8fe85752248942c89c4

Contents?: true

Size: 892 Bytes

Versions: 25

Compression:

Stored size: 892 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/helper')

class TestProjectGenerator < Test::Unit::TestCase
  def setup
    @apptmp = "#{Dir.tmpdir}/appjam-tests/#{UUID.new.generate}"
    `mkdir -p #{@apptmp}`
  end

  def teardown
    `rm -rf #{@apptmp}`
    `rm -rf /tmp/project`
  end
  
  context 'the project generator' do  
  
    should "do not allow create model outside iphone project folder" do
      assert_nothing_raised { silence_logger { generate(:project, 'sample_project', "--root=#{@apptmp}") } }
      assert_raise(::NameError) { silence_logger { generate(:model, "user") } }
    end  
    
    should "raise an Error when given invalid constant names for model" do
      assert_raise(::NameError) { silence_logger { generate(:model, "123asdf") } }
      assert_raise(::NameError) { silence_logger { generate(:model, "./sample_project") } }
    end    
    
  end
  
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
appjam-0.1.8.6 test/test_model_generator.rb
appjam-0.1.8.5 test/test_model_generator.rb
appjam-0.1.8.4 test/test_model_generator.rb
appjam-0.1.8.3 test/test_model_generator.rb
appjam-0.1.8.2 test/test_model_generator.rb
appjam-0.1.8.1 test/test_model_generator.rb
appjam-0.1.8 test/test_model_generator.rb
appjam-0.1.8.pre13 test/test_model_generator.rb
appjam-0.1.8.pre12 test/test_model_generator.rb
appjam-0.1.8.pre11 test/test_model_generator.rb
appjam-0.1.8.pre10 test/test_model_generator.rb
appjam-0.1.8.pre9 test/test_model_generator.rb
appjam-0.1.8.pre7 test/test_model_generator.rb
appjam-0.1.8.pre6 test/test_model_generator.rb
appjam-0.1.8.pre5 test/test_model_generator.rb
appjam-0.1.8.pre3 test/test_model_generator.rb
appjam-0.1.8.pre test/test_model_generator.rb
appjam-0.1.7.1 test/test_model_generator.rb
appjam-0.1.7 test/test_model_generator.rb
appjam-0.1.6 test/test_model_generator.rb