Class: Moto::Test
Class Attribute Summary collapse
-
._path ⇒ Object
Returns the value of attribute _path.
Instance Attribute Summary collapse
-
#context ⇒ Object
writeonly
Sets the attribute context.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#result ⇒ Object
Returns the value of attribute result.
-
#static_path ⇒ Object
writeonly
Sets the attribute static_path.
Class Method Summary collapse
Instance Method Summary collapse
- #after ⇒ Object
- #before ⇒ Object
- #client(name) ⇒ Object
- #const(key) ⇒ Object
- #dir ⇒ Object
- #filename ⇒ Object
- #init(env, params) ⇒ Object
-
#initialize ⇒ Test
constructor
A new instance of Test.
- #logger ⇒ Object
- #path ⇒ Object
- #run ⇒ Object
- #set_name ⇒ Object
Methods included from Assert
Constructor Details
Class Attribute Details
._path ⇒ Object
Returns the value of attribute _path.
14 15 16 |
# File 'lib/test.rb', line 14 def _path @_path end |
Instance Attribute Details
#context=(value) ⇒ Object (writeonly)
Sets the attribute context
6 7 8 |
# File 'lib/test.rb', line 6 def context=(value) @context = value end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/test.rb', line 9 def env @env end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/test.rb', line 8 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/test.rb', line 10 def params @params end |
#result ⇒ Object
Returns the value of attribute result.
7 8 9 |
# File 'lib/test.rb', line 7 def result @result end |
#static_path=(value) ⇒ Object (writeonly)
Sets the attribute static_path
11 12 13 |
# File 'lib/test.rb', line 11 def static_path=(value) @static_path = value end |
Class Method Details
.inherited(k) ⇒ Object
17 18 19 |
# File 'lib/test.rb', line 17 def self.inherited(k) k._path = caller.first.match( /(.+):\d+:in/ )[1] end |
Instance Method Details
#after ⇒ Object
69 70 71 |
# File 'lib/test.rb', line 69 def after # abstract end |
#before ⇒ Object
65 66 67 |
# File 'lib/test.rb', line 65 def before # abstract end |
#client(name) ⇒ Object
73 74 75 |
# File 'lib/test.rb', line 73 def client(name) @context.client(name) end |
#const(key) ⇒ Object
57 58 59 |
# File 'lib/test.rb', line 57 def const(key) @context.const(key) end |
#dir ⇒ Object
46 47 48 49 50 |
# File 'lib/test.rb', line 46 def dir # puts self.class.path return File.dirname(@static_path) unless @static_path.nil? File.dirname(self.path) end |
#filename ⇒ Object
52 53 54 55 |
# File 'lib/test.rb', line 52 def filename return File.basename(@static_path, ".*") unless @static_path.nil? File.basename(path, ".*") end |
#init(env, params) ⇒ Object
30 31 32 33 34 |
# File 'lib/test.rb', line 30 def init(env, params) @env = env @params = params set_name end |
#logger ⇒ Object
36 37 38 |
# File 'lib/test.rb', line 36 def logger @context.logger end |
#path ⇒ Object
21 22 23 |
# File 'lib/test.rb', line 21 def path self.class._path end |
#run ⇒ Object
61 62 63 |
# File 'lib/test.rb', line 61 def run # abstract end |
#set_name ⇒ Object
40 41 42 43 44 |
# File 'lib/test.rb', line 40 def set_name return @name = "#{self.class.to_s}/#{@env}" if @params.empty? return @name = "#{self.class.to_s}/#{@env}/#{@params[:__name]}" if @params.key?(:__name) @name = self.class.to_s end |