class Crew::Home::DSL
Public Class Methods
new(home)
click to toggle source
# File lib/crew/home/dsl.rb, line 4 def initialize(home) @home = home end
Public Instance Methods
after(&cb)
click to toggle source
# File lib/crew/home/dsl.rb, line 12 def after(&cb) @home.add_callback(:after, &cb) end
before(&cb)
click to toggle source
# File lib/crew/home/dsl.rb, line 8 def before(&cb) @home.add_callback(:before, &cb) end
context(name, &blk)
click to toggle source
# File lib/crew/home/dsl.rb, line 21 def context(name, &blk) @home.add_context(name, &blk) end
default_context(name)
click to toggle source
# File lib/crew/home/dsl.rb, line 25 def default_context(name) @home.default_context_name = name end
default_test(name)
click to toggle source
# File lib/crew/home/dsl.rb, line 41 def default_test(name) @home.default_test_name = name end
hint(hint)
click to toggle source
# File lib/crew/home/dsl.rb, line 33 def hint(hint) @home.hints << hint end
load(path = nil, &blk)
click to toggle source
# File lib/crew/home/dsl.rb, line 16 def load(path = nil, &blk) instance_eval(File.read(path), path, 1) if path instance_eval(&blk) if blk end
source(source)
click to toggle source
# File lib/crew/home/dsl.rb, line 29 def source(source) @home.sources << source end
test(name, &blk)
click to toggle source
# File lib/crew/home/dsl.rb, line 37 def test(name, &blk) @home.add_tester(name, &blk) end