CIT 591 Testing and running Shoes Fall 2009, David Matuszek
Here is an example of a trivial Shoes GUI with separate model and test files.
def double n 2 * n end
require 'model' Shoes.app do stack do number = edit_line button "Double" do number.text = double(number.text.to_i).to_s end end end
How to run this:
example_gui.rb.
require "test/unit" require "model" class ModelTest < Test::Unit::TestCase def test_double assert_equal 26, double(13) end end
ruby test.rb