Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
#in test_helper.rb, i modified it : #self.use_transactional_fixtures = false require File.dirname(__FILE__) + '/../test_helper' class ListTest < Test::Unit::TestCase def test_truth ActiveRecord::Base.transaction do @check_in = "2008-07-01".to_date @jml_diminta = 3 @token_id = "ABCD" status = "penerbangan_id" @product = Penerbangan.find(70) @kode_item = "#{@product.id}#{@product.no_penerbangan}" @stock = @product.jumlah_tiket.to_i @jumlah_dikotak = BarangTerpesan.hitung_item_dikotak(@kode_item, @check_in, @check_out).to_i @jml_dipesan = Pemesanan.hitung_barang_sudah_dipesan(@check_in, @check_out, 70, status).to_i if @jml_diminta + @jumlah_dikotak + @jml_dipesan <= @stock if sleep 30 chars = ("a".."z").to_a + ("1".."15").to_a new_kode = Array.new(8, '').collect{chars[rand(chars.size)]}.join end BarangTerpesan.simpan_baru(new_kode, @kode_item, @jml_diminta, @check_in, @check_out ) end end end end
This paste will be private.
From the Design Piracy series on my blog: