Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
#RAKEFILE require 'spec/rake/spectask' #Rules for all tasks. task :run => [:build,:test] task :ci => [:gui] task :test => [:build] #Tasks for running tests desc "Run all tests for rbgooey with rcov" Spec::Rake::SpecTask.new('gui') do |t| t.spec_files = FileList['rbgooey/test/test.rb'] t.rcov = true t.rcov_opts = ['--exclude', '/usr/local/lib/site_ruby'] end desc "Run all tests for rbgooey without rcov" Spec::Rake::SpecTask.new('test') do |t| t.spec_files = FileList['rbgooey/test/test.rb'] t.rcov = false end #Commit task task :ci do sh "svn st" sh "svn ci" end #Build and install gems task task :build do sh "gem build rbgooey.gemspec" sh "sudo gem install rbGooey-0.0.1 --local" end #Build gem, run tests, run dynpet.rb task :run do sh "ruby dynpet.rb" end #test.rb require"rubygems" require"rubygame" gui = Dir.glob("rbgooey/lib/*.rb") gui.each do |data| require(data) end require"rbgooey/test/main_init.rb" require"rbgooey/test/mainscreen.rb" require"rbgooey/test/mainflags.rb" include Rubygame #main_init.rb context "A new Main object" do setup do @main = Main.new end specify "should have all of their instance variables empty" do @main.screen.should == nil @main.background.should == nil @main.font.should == nil @main.bgcolor.should == nil @main.fgcolor.should == nil @main.size.should == nil @main.y.should == nil end specify "should have instance variable @cursor return the value true when initialized" do @main.cursor.should == true end specify "should have instance variable @flags return all the flags when initialized" do @main.flags.should == [Rubygame::HWSURFACE,Rubygame::DOUBLEBUF] end end #mainscreen.rb context "instance variable @screen of Main object" do setup do @main = Main.new end specify "should have @screen.size return [800 , 600] when 'set_new(800,600)' is called" do @main.set_new(800,600) @main.screen.size.should == [800,600] end specify "should stay the same when set_new is called without agurement" do @main.set_new(800,600) @main.set_new() @main.screen.size.should == [800,600] end specify "should return false when set_new is called without agurement after specifying set_new agurement with false for cursor value" do @main.set_new(800,600,false) @main.set_new() @main.cursor.should == false end specify "should return a new extra flag called Rubygame::FULLSCREEN" do @main.set_new(800,600) @main.add(1) @main.screen.flags[-1] == Rubygame::FULLSCREEN Rubygame.quit() end end #mainflags context "@flags of Main object" do setup do @main = Main.new @main.set_new(800,600) end specify "should return via flags.length() as 3 when method add of Main is called" do @main.add(1) @main.flags.length.should() == 3 end specify "should return via flags.last() as Rubygame::FULLSCREEN when method add of Main is called" do @main.add(1) @main.flags.last.should == Rubygame::FULLSCREEN Rubygame.quit() end end
This paste will be private.
From the Design Piracy series on my blog: