Class: Testrus::Input
- Inherits:
-
Object
- Object
- Testrus::Input
- Defined in:
- lib/testrus/input.rb,
lib/testrus/input/file.rb
Defined Under Namespace
Classes: File
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Input
constructor
Public: Initializes a new Input.
-
#input ⇒ Object
Public: Returns the formatted input.
-
#name ⇒ Object
Public: Returns the name of the input/output pair.
-
#output ⇒ Object
(also: #expected_output)
Public: Returns the formatted expected output.
Constructor Details
#initialize(options) ⇒ Input
Public: Initializes a new Input. An Input is the standard object from an Input source to the Tester.
options - The Hash specifying the input options:
:input - The String input matching the expected output.
:output - The String expected output from the program for the
associated input.
:name - The String name of the input, this is usually the
number of the test relative to the others, and should be
provided by the source.
16 17 18 |
# File 'lib/testrus/input.rb', line 16 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/testrus/input.rb', line 3 def @options end |
Instance Method Details
#input ⇒ Object
Public: Returns the formatted input.
26 27 28 |
# File 'lib/testrus/input.rb', line 26 def input @options[:input].strip end |
#name ⇒ Object
Public: Returns the name of the input/output pair.
21 22 23 |
# File 'lib/testrus/input.rb', line 21 def name @options[:name].strip end |
#output ⇒ Object Also known as: expected_output
Public: Returns the formatted expected output.
31 32 33 |
# File 'lib/testrus/input.rb', line 31 def output @options[:output].strip end |