Sha256: 366aa385a297a1978c1e1ce07b6027bfcfa2b35f2c502fed8e604b909868e47f

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

require File.dirname(__FILE__) + '/test_helper.rb'
require 'fileutils'
require 'pp'
require 'pathname'
include FileUtils

class NewCocoaTest < Test::Unit::TestCase
	def setup
		@testdir = Pathname.new(File.dirname(__FILE__)).realpath
		@newgem = @testdir + '../bin/newcocoa'
		system(@newgem, 'testcocoa')
	end

	def teardown
		rm_rf 'testcocoa'
	end

	def test_load
		assert true
	end

	def test_create
		cd 'testcocoa' do
			assert_equal(Dir['**/*'], [
			"English.lproj",
			"html",
			"Info.plist.erb",
			"main.m",
			"main.rb",
			"Rakefile",
			"README",
			"English.lproj/Main.nib",
			"English.lproj/Main.nib/classes.nib",
			"English.lproj/Main.nib/info.nib",
			"English.lproj/Main.nib/keyedobjects.nib"
			])
		end
	end

	def test_convert
		cd 'testcocoa' do
			cp @testdir + 'TestHeader.h', '.'
			system(@newgem, '-c')
			res = Pathname.new 'TestHeader.rb'
			assert res.exist?, 'Create Converted .rb'

			time = res.mtime
			system(@newgem, '-c')
			assert_equal time, res.mtime, 'No overwrite existed .rb'

			res.unlink

			system(@newgem, '-c', 'TestHeader.h')
			assert res.exist?, 'Create Converted .rb, -c'
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newcocoa-0.0.3 test/newcocoa_test.rb
newcocoa-0.0.1 test/newcocoa_test.rb
newcocoa-0.0.2 test/newcocoa_test.rb