minilab 1.0.0-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/.document +2 -0
  2. data/CHANGES +2 -0
  3. data/LICENSE +19 -0
  4. data/README +107 -0
  5. data/Rakefile +145 -0
  6. data/config/environment.rb +15 -0
  7. data/config/objects.yml +22 -0
  8. data/lib/analog_io.rb +30 -0
  9. data/lib/digital_auxport_io.rb +49 -0
  10. data/lib/digital_configuration.rb +66 -0
  11. data/lib/digital_port_io.rb +68 -0
  12. data/lib/extension/extconf.rb +4 -0
  13. data/lib/extension/minilab_hardware.c +235 -0
  14. data/lib/extension/minilab_hardware.so +0 -0
  15. data/lib/library_translator.rb +48 -0
  16. data/lib/minilab.rb +149 -0
  17. data/lib/minilab_context.rb +39 -0
  18. data/lib/result_verifier.rb +14 -0
  19. data/test/integration/analog_input_output_test.rb +43 -0
  20. data/test/integration/connect_to_hardware_test.rb +13 -0
  21. data/test/integration/digital_input_output_test.rb +114 -0
  22. data/test/integration/integration_test.rb +53 -0
  23. data/test/integration/require_minilab_test.rb +9 -0
  24. data/test/system/analog_input.test +3 -0
  25. data/test/system/analog_output.test +37 -0
  26. data/test/system/digital_port_input.test +5 -0
  27. data/test/system/digital_port_output.test +39 -0
  28. data/test/system/digital_port_read_byte.test +26 -0
  29. data/test/system/digital_screw_terminals_input.test +2 -0
  30. data/test/system/digital_screw_terminals_output.test +11 -0
  31. data/test/system/minilab_driver.rb +85 -0
  32. data/test/test_helper.rb +11 -0
  33. data/test/unit/analog_io_test.rb +87 -0
  34. data/test/unit/digital_auxport_io_test.rb +114 -0
  35. data/test/unit/digital_configuration_test.rb +136 -0
  36. data/test/unit/digital_port_io_test.rb +117 -0
  37. data/test/unit/library_translator_test.rb +100 -0
  38. data/test/unit/minilab_context_test.rb +82 -0
  39. data/test/unit/minilab_hardware_test.rb +83 -0
  40. data/test/unit/minilab_test.rb +131 -0
  41. data/test/unit/result_verifier_test.rb +33 -0
  42. data/vendor/behaviors/lib/behaviors.rb +50 -0
  43. data/vendor/behaviors/tasks/behaviors_tasks.rake +140 -0
  44. data/vendor/behaviors/test/behaviors_tasks_test.rb +71 -0
  45. data/vendor/behaviors/test/behaviors_test.rb +50 -0
  46. data/vendor/behaviors/test/tasks_test/Rakefile +16 -0
  47. data/vendor/behaviors/test/tasks_test/doc/behaviors.html +55 -0
  48. data/vendor/behaviors/test/tasks_test/lib/user.rb +2 -0
  49. data/vendor/behaviors/test/tasks_test/test/user_test.rb +17 -0
  50. data/vendor/constructor/Rakefile +44 -0
  51. data/vendor/constructor/config/environment.rb +12 -0
  52. data/vendor/constructor/lib/constructor.rb +132 -0
  53. data/vendor/constructor/test/constructor_test.rb +366 -0
  54. data/vendor/constructor/test/helper.rb +3 -0
  55. data/vendor/diy/README +26 -0
  56. data/vendor/diy/Rakefile +18 -0
  57. data/vendor/diy/lib/constructor.rb +114 -0
  58. data/vendor/diy/lib/diy.rb +329 -0
  59. data/vendor/diy/proto/context.rb +117 -0
  60. data/vendor/diy/proto/context.yml +20 -0
  61. data/vendor/diy/test/diy_test.rb +370 -0
  62. data/vendor/diy/test/files/broken_construction.yml +7 -0
  63. data/vendor/diy/test/files/cat/cat.rb +4 -0
  64. data/vendor/diy/test/files/cat/extra_conflict.yml +5 -0
  65. data/vendor/diy/test/files/cat/heritage.rb +2 -0
  66. data/vendor/diy/test/files/cat/needs_input.yml +3 -0
  67. data/vendor/diy/test/files/cat/the_cat_lineage.rb +1 -0
  68. data/vendor/diy/test/files/dog/dog_model.rb +4 -0
  69. data/vendor/diy/test/files/dog/dog_presenter.rb +4 -0
  70. data/vendor/diy/test/files/dog/dog_view.rb +2 -0
  71. data/vendor/diy/test/files/dog/file_resolver.rb +2 -0
  72. data/vendor/diy/test/files/dog/other_thing.rb +2 -0
  73. data/vendor/diy/test/files/dog/simple.yml +11 -0
  74. data/vendor/diy/test/files/donkey/foo.rb +8 -0
  75. data/vendor/diy/test/files/donkey/foo/bar/qux.rb +7 -0
  76. data/vendor/diy/test/files/fud/objects.yml +13 -0
  77. data/vendor/diy/test/files/fud/toy.rb +15 -0
  78. data/vendor/diy/test/files/gnu/objects.yml +14 -0
  79. data/vendor/diy/test/files/gnu/thinger.rb +8 -0
  80. data/vendor/diy/test/files/goat/base.rb +8 -0
  81. data/vendor/diy/test/files/goat/can.rb +6 -0
  82. data/vendor/diy/test/files/goat/goat.rb +6 -0
  83. data/vendor/diy/test/files/goat/objects.yml +12 -0
  84. data/vendor/diy/test/files/goat/paper.rb +6 -0
  85. data/vendor/diy/test/files/goat/plane.rb +8 -0
  86. data/vendor/diy/test/files/goat/shirt.rb +6 -0
  87. data/vendor/diy/test/files/goat/wings.rb +8 -0
  88. data/vendor/diy/test/files/horse/holder_thing.rb +4 -0
  89. data/vendor/diy/test/files/horse/objects.yml +7 -0
  90. data/vendor/diy/test/files/yak/core_model.rb +4 -0
  91. data/vendor/diy/test/files/yak/core_presenter.rb +4 -0
  92. data/vendor/diy/test/files/yak/core_view.rb +1 -0
  93. data/vendor/diy/test/files/yak/data_source.rb +1 -0
  94. data/vendor/diy/test/files/yak/fringe_model.rb +4 -0
  95. data/vendor/diy/test/files/yak/fringe_presenter.rb +4 -0
  96. data/vendor/diy/test/files/yak/fringe_view.rb +1 -0
  97. data/vendor/diy/test/files/yak/my_objects.yml +21 -0
  98. data/vendor/diy/test/test_helper.rb +40 -0
  99. data/vendor/hardmock/CHANGES +8 -0
  100. data/vendor/hardmock/LICENSE +7 -0
  101. data/vendor/hardmock/README +48 -0
  102. data/vendor/hardmock/Rakefile +100 -0
  103. data/vendor/hardmock/TODO +7 -0
  104. data/vendor/hardmock/config/environment.rb +12 -0
  105. data/vendor/hardmock/homepage/demo.rb +21 -0
  106. data/vendor/hardmock/homepage/hardmock_sample.png +0 -0
  107. data/vendor/hardmock/homepage/index.html +65 -0
  108. data/vendor/hardmock/init.rb +3 -0
  109. data/vendor/hardmock/lib/hardmock.rb +634 -0
  110. data/vendor/hardmock/lib/method_cleanout.rb +14 -0
  111. data/vendor/hardmock/rcov.rake +18 -0
  112. data/vendor/hardmock/test/functional/assert_error_test.rb +52 -0
  113. data/vendor/hardmock/test/functional/auto_verify_test.rb +192 -0
  114. data/vendor/hardmock/test/functional/direct_mock_usage_test.rb +396 -0
  115. data/vendor/hardmock/test/functional/hardmock_test.rb +380 -0
  116. data/vendor/hardmock/test/test_helper.rb +23 -0
  117. data/vendor/hardmock/test/unit/expectation_builder_test.rb +18 -0
  118. data/vendor/hardmock/test/unit/expector_test.rb +56 -0
  119. data/vendor/hardmock/test/unit/method_cleanout_test.rb +35 -0
  120. data/vendor/hardmock/test/unit/mock_control_test.rb +172 -0
  121. data/vendor/hardmock/test/unit/mock_test.rb +273 -0
  122. data/vendor/hardmock/test/unit/simple_expectation_test.rb +345 -0
  123. data/vendor/hardmock/test/unit/trapper_test.rb +60 -0
  124. data/vendor/hardmock/test/unit/verify_error_test.rb +34 -0
  125. data/vendor/systir/systir.rb +403 -0
  126. data/vendor/systir/test/unit/ui/xml/testrunner.rb +192 -0
  127. data/vendor/systir/test/unit/ui/xml/xmltestrunner.xslt +109 -0
  128. metadata +235 -0
@@ -0,0 +1,13 @@
1
+ widget:
2
+ lib: toy
3
+
4
+ trinket:
5
+ lib: toy
6
+ compose: thing_ama_jack
7
+
8
+ thing_ama_jack:
9
+ lib: toy
10
+
11
+ toy:
12
+ lib: toy
13
+ compose: widget, trinket
@@ -0,0 +1,15 @@
1
+ require 'constructor'
2
+
3
+ class Toy
4
+ constructor :widget, :trinket, :accessors => true, :strict => true
5
+ end
6
+
7
+ class Widget
8
+ end
9
+
10
+ class ThingAmaJack
11
+ end
12
+
13
+ class Trinket
14
+ constructor :thing_ama_jack, :accessors => true, :strict => true
15
+ end
@@ -0,0 +1,14 @@
1
+
2
+ injected:
3
+
4
+ thinger:
5
+ compose: injected
6
+
7
+ +inny:
8
+ inner_injected:
9
+
10
+ inner_thinger:
11
+ injected: inner_injected
12
+ lib: thinger
13
+ class: Thinger
14
+
@@ -0,0 +1,8 @@
1
+
2
+ require 'constructor'
3
+
4
+ class Thinger
5
+ constructor :injected
6
+ attr_reader :injected
7
+ end
8
+
@@ -0,0 +1,8 @@
1
+ class Base
2
+ def test_output(name)
3
+ # See diy_context_test.rb
4
+ File.open($goat_test_output_file, "a") do |f|
5
+ f.puts "#{name} built"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ require 'base'
2
+ class Can < Base
3
+ def initialize
4
+ test_output "can"
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'base'
2
+ class Goat < Base
3
+ def initialize
4
+ test_output "goat"
5
+ end
6
+ end
@@ -0,0 +1,12 @@
1
+ can:
2
+
3
+ paper:
4
+
5
+ shirt:
6
+
7
+ goat:
8
+
9
+ +the_sub_context:
10
+ plane:
11
+ compose: wings
12
+ wings:
@@ -0,0 +1,6 @@
1
+ require 'base'
2
+ class Paper < Base
3
+ def initialize
4
+ test_output "paper"
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ require 'base'
2
+ require 'constructor'
3
+ class Plane < Base
4
+ constructor :wings, :strict => true
5
+ def setup
6
+ test_output "plane"
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ require 'base'
2
+ class Shirt < Base
3
+ def initialize
4
+ test_output "shirt"
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ require 'base'
2
+ class Wings < Base
3
+ def initialize
4
+ test_output "wings"
5
+ end
6
+ def stay_on; end
7
+ def fall_off; end
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'constructor'
2
+ class HolderThing
3
+ constructor :thing_held, :strict => true, :accessors => true
4
+ end
@@ -0,0 +1,7 @@
1
+ holder_thing:
2
+ thing_held: this_context
3
+
4
+ +repeater:
5
+ other_thing:
6
+ class: HolderThing
7
+ thing_held: this_context
@@ -0,0 +1,4 @@
1
+ require 'constructor'
2
+ class CoreModel
3
+ constructor :data_source, :strict => true
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'constructor'
2
+ class CorePresenter
3
+ constructor :model, :view, :strict => true
4
+ end
@@ -0,0 +1 @@
1
+ class CoreView; end
@@ -0,0 +1 @@
1
+ class DataSource; end
@@ -0,0 +1,4 @@
1
+ require 'constructor'
2
+ class FringeModel
3
+ constructor :connected, :accessors => true, :strict => true
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'constructor'
2
+ class FringePresenter
3
+ constructor :fringe_model, :fringe_view, :strict => true
4
+ end
@@ -0,0 +1 @@
1
+ class FringeView; end
@@ -0,0 +1,21 @@
1
+
2
+ core_model:
3
+ compose: data_source
4
+
5
+ core_view:
6
+
7
+ core_presenter:
8
+ model: core_model
9
+ view: core_view
10
+
11
+ data_source:
12
+
13
+ +fringe_context:
14
+
15
+ fringe_model:
16
+ connected: core_model
17
+
18
+ fringe_view:
19
+
20
+ fringe_presenter:
21
+ compose: fringe_model, fringe_view
@@ -0,0 +1,40 @@
1
+ here = File.expand_path(File.dirname(__FILE__))
2
+ PROJ_ROOT = File.expand_path("#{here}/..")
3
+ $: << "#{PROJ_ROOT}/src"
4
+ $: << "#{PROJ_ROOT}/test"
5
+ $: << "#{PROJ_ROOT}/lib"
6
+ require 'test/unit'
7
+ require 'fileutils'
8
+ require 'find'
9
+ require 'yaml'
10
+ require 'ostruct'
11
+
12
+ class Test::Unit::TestCase
13
+ include FileUtils
14
+
15
+ def path_to(file)
16
+ File.expand_path(File.dirname(__FILE__)) + file
17
+ end
18
+
19
+ def not_done
20
+ flunk "IMPLEMENT ME"
21
+ end
22
+ alias :implement_me :not_done
23
+
24
+ def poll(time_limit)
25
+ (time_limit * 10).to_i.times do
26
+ return true if yield
27
+ sleep 0.1
28
+ end
29
+ return false
30
+ end
31
+
32
+ def self.method_added(msym)
33
+ # Prevent duplicate test methods
34
+ if msym.to_s =~ /^test_/
35
+ @_tracked_tests ||= {}
36
+ raise "Duplicate test #{msym}" if @_tracked_tests[msym]
37
+ @_tracked_tests[msym] = true
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,8 @@
1
+ Hardmock 1.0.3
2
+
3
+ * "expects" replaces "expect" ("expect" now raises Hardmock::DeprecationError)
4
+ * "verify_mocks" is now implicit in teardown, you needn't call it anymore
5
+ * Mocking methods that Mock would otherwise inherit from Object (eg, to_s) is now possible
6
+ * require 'hardmock' is all that's required to use the library now; no need to include in TestCase
7
+
8
+ (previously called CMock, translated to Hardmock on 2006-12-10)
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2006 Atomic Object, LLC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+ == Hardmock
2
+
3
+ Strict, ordered mock objects using very lightweight syntax in your tests.
4
+
5
+
6
+ == How
7
+
8
+ The basic procedure for using Hardmock in your tests is:
9
+
10
+ * require 'hardmock'
11
+ * Create some mocks
12
+ * Setup some expectations
13
+ * Execute the target code
14
+ * Verification of calls is automatic in =teardown=
15
+
16
+ The expectations you set when using mocks are <b>strict</b> and <b>ordered</b>.
17
+ Expectations you declare by creating and using mocks are all considered together.
18
+
19
+ * Hardmock::Mock#expects will show you more examples
20
+ * Hardmock::SimpleExpectation will teach you more about expectation methods
21
+
22
+ == Example
23
+
24
+ create_mocks :garage, :car
25
+
26
+ # Set some expectations
27
+ @garage.expects.open_door
28
+ @car.expects.start(:choke)
29
+ @car.expects.drive(:reverse, 5.mph)
30
+
31
+ # Execute the code (this code is usually, obviously, in your class under test)
32
+ @garage.open_door
33
+ @car.start :choke
34
+ @car.drive :reverse, 5.mph
35
+
36
+ verify_mocks # OPTIONAL, teardown will do this for you
37
+
38
+ Expects <tt>@garage.open_door</tt>, <tt>@car.start(:choke)</tt> and <tt>@car.drive(:reverse, 5.mph)</tt> to be called in that order, with those specific arguments.
39
+ * Violations of expectations, such as mis-ordered calls, calls on wrong objects, or incorrect methods result in Hardmock::ExpectationError
40
+ * <tt>verify_mocks</tt> will raise VerifyError if not all expectations have been met.
41
+
42
+ == Download and Install
43
+
44
+ * Homepage: http://hardmock.rubyforge.org
45
+ * GEM or TGZ or ZIP: http://rubyforge.org/frs/?group_id=2742
46
+ * Rails plugin: script/plugin install
47
+ * SVN access: svn co svn://rubyforge.org/var/svn/hardmock/trunk
48
+ * Developer SVN access: svn co svn://developername@rubyforge.org/var/svn/hardmock/trunk
@@ -0,0 +1,100 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+ require 'rubygems'
5
+ require 'rake/gempackagetask'
6
+ require 'rake/contrib/sshpublisher'
7
+ load 'rcov.rake'
8
+
9
+ HARDMOCK_VERSION = "1.2.0"
10
+
11
+ task :default => [ :alltests ]
12
+
13
+ desc "Run all the tests"
14
+ Rake::TestTask.new("alltests") { |t|
15
+ t.libs << "test"
16
+ t.pattern = 'test/**/*_test.rb'
17
+ t.verbose = true
18
+ }
19
+
20
+ def add_rdoc_options(options)
21
+ options << '--line-numbers' << '--inline-source' << '--main' << 'README' << '--title' << 'Hardmock'
22
+ end
23
+
24
+ desc "Generate RDoc documentation"
25
+ Rake::RDocTask.new { |rdoc|
26
+ rdoc.rdoc_dir = 'doc'
27
+ rdoc.title = "Hardmock: Strict expectation-based mock object library "
28
+ # rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' << '--main'
29
+ add_rdoc_options(rdoc.options)
30
+ rdoc.rdoc_files.include('lib/**/*.rb', 'README','CHANGES','LICENSE')
31
+ }
32
+
33
+ task :showdoc => [ :rerdoc ] do
34
+ sh "open doc/index.html"
35
+ end
36
+
37
+ desc "Generate and upload api docs to rubyforge"
38
+ task :upload_doc => :rerdoc do
39
+ sh "scp -r doc/* rubyforge.org:/var/www/gforge-projects/hardmock/doc"
40
+ sh "scp -r homepage/* rubyforge.org:/var/www/gforge-projects/hardmock/"
41
+ end
42
+
43
+
44
+
45
+ gem_spec = Gem::Specification.new do | s |
46
+ s.name = "hardmock"
47
+ s.version = HARDMOCK_VERSION
48
+ s.author = "David Crosby"
49
+ s.email = "crosby@atomicobject.com"
50
+ s.platform = Gem::Platform::RUBY
51
+ s.summary = "A strict, ordered, expectation-oriented mock object library."
52
+ s.rubyforge_project = 'hardmock'
53
+ s.homepage = "http://hardmock.rubyforge.org"
54
+ s.autorequire = 'hardmock'
55
+
56
+ s.files = FileList['{lib,test}/**/*.rb', '[A-Z]*'].exclude('TODO').to_a
57
+
58
+ s.require_path = "lib"
59
+ s.test_files = Dir.glob("test/**/*test.rb")
60
+
61
+ s.has_rdoc = true
62
+ s.extra_rdoc_files = ["README","CHANGES","LICENSE"]
63
+ add_rdoc_options(s.rdoc_options)
64
+ end
65
+
66
+ Rake::GemPackageTask.new(gem_spec) do |pkg|
67
+ pkg.need_zip = true
68
+ pkg.need_tar = true
69
+ end
70
+
71
+ task :verify_svn_clean do
72
+ # Get clean
73
+ sh 'svn up'
74
+ status = `svn status`
75
+ raise "Please get checked-in and cleaned up before releasing.\n#{status}" unless status == ""
76
+ end
77
+
78
+ desc "Create a release tar.gz file."
79
+ task :release => [:verify_svn_clean, :alltests, :upload_doc, :repackage] do
80
+ require 'fileutils'
81
+ include FileUtils::Verbose
82
+ proj_root = File.expand_path(File.dirname(__FILE__))
83
+ begin
84
+ cd proj_root
85
+
86
+
87
+ # Tag the release by number, then re-tag for stable release (makes nicey nicey for Rails plugin installation)
88
+ sh "svn cp . svn+ssh://dcrosby42@rubyforge.org/var/svn/hardmock/tags/rel-#{HARDMOCK_VERSION} -m 'Releasing version #{HARDMOCK_VERSION}'"
89
+ sh "svn del svn+ssh://dcrosby42@rubyforge.org/var/svn/hardmock/tags/hardmock -m 'Preparing to update stable release tag'"
90
+ sh "svn cp . svn+ssh://dcrosby42@rubyforge.org/var/svn/hardmock/tags/hardmock -m 'Updating stable tag to version #{HARDMOCK_VERSION}'"
91
+
92
+ puts "UPLOAD #{Dir['pkg/*.*']} TO RUBYFORGE RELEASE ZONE"
93
+ end
94
+ end
95
+
96
+
97
+ namespace :ci do
98
+ desc "Continuous integration target"
99
+ task :continuous => [ 'alltests', 'rcov:coverage' ]
100
+ end
@@ -0,0 +1,7 @@
1
+ Sun Dec 10 09:15:26 EST 2006
2
+ crosby
3
+
4
+ TODO:
5
+ * Validate Rails plugin usage
6
+ * Mock actual methods on actual objects or classes or modules?
7
+ * Achieve clarity on "yields"
@@ -0,0 +1,12 @@
1
+ # The path to the root directory of your application.
2
+ APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
+
4
+ ADDITIONAL_LOAD_PATHS = []
5
+ ADDITIONAL_LOAD_PATHS.concat %w(
6
+ lib
7
+ ).map { |dir| "#{APP_ROOT}/#{dir}" }.select { |dir| File.directory?(dir) }
8
+
9
+ # Prepend to $LOAD_PATH
10
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
11
+
12
+ # Require any additional libraries needed
@@ -0,0 +1,21 @@
1
+ require 'hardmock'
2
+
3
+ class MyTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ create_mocks :garage, :car
7
+ end
8
+
9
+ def test_the_mocks
10
+ # Set some expectations
11
+ @garage.expects.open_door
12
+ @car.expects.start(:choke)
13
+ @car.expects.drive(:reverse, 5.mph)
14
+
15
+ # Execute the code (normally your own classes do this)
16
+ @garage.open_door
17
+ @car.start :choke
18
+ @car.drive :reverse, 5.mph
19
+ end
20
+
21
+ end