Skip to content

Commit

Permalink
Added notice about segfault in Gosu::Window usage
Browse files Browse the repository at this point in the history
  • Loading branch information
cadwallion committed Nov 29, 2011
1 parent fc2fbf9 commit 408deaa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/main_window.rb
Expand Up @@ -3,7 +3,6 @@
require 'ball'

class MainWindow < Gosu::Window

TITLE = "Bouncing Ball"

def initialize
Expand Down
21 changes: 21 additions & 0 deletions spec/main_window_spec.rb
@@ -0,0 +1,21 @@
require 'spec_helper'

# there is a segfault bug that is caused when you try to re-use a Gosu::MainWindow
describe MainWindow do
def ball
@ball = double()
@ball.stub(:draw) { }
@ball.stub(:x) { 5 }
@ball.stub(:y) { 5 }
@ball.stub(:width) { 50 }
@ball.stub(:height) { 50 }
@ball
end
describe "#initialize" do
it "create a new ball" do
Ball.should_receive(:new) { ball }
@x = MainWindow.new
@x.close
end
end
end

0 comments on commit 408deaa

Please sign in to comment.