Module: Pione::TestHelper

Defined in:
lib/pione/test-helper.rb,
lib/pione/test-helper/webserver.rb,
lib/pione/test-helper/lang-helper.rb,
lib/pione/test-helper/tuple-helper.rb,
lib/pione/test-helper/parser-helper.rb,
lib/pione/test-helper/command-helper.rb,
lib/pione/test-helper/package-helper.rb,
lib/pione/test-helper/location-helper.rb,
lib/pione/test-helper/transformer-helper.rb,
lib/pione/test-helper/tuple-space-helper.rb,
lib/pione/test-helper/internet-connectivity.rb

Defined Under Namespace

Modules: InternetConnectivity, Lang, Location, Package, Parser, Transformer, TransformerInterface, Tuple, TupleSpace Classes: LangReader, PioneClientRunner, TestPioneMethod, TestPioneMethodItem, WebServer

Constant Summary collapse

DIR =
Location[File.dirname(__FILE__)]
TEST_DATA_DIR =
DIR + "test-data"
TEST_PACKAGE_DIR =
TEST_DATA_DIR + "package"

Class Method Summary collapse

Class Method Details

.scope(&b) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/pione/test-helper.rb', line 33

def self.scope(&b)
  @scope_id = (@scope_id || 0) + 1
  mod = Module.new
  const_set("MODULE%s" % @scope_id, mod)
  mod.send(:define_method, :this) do
    mod
  end
  mod.module_eval(&b)
end

.scope_of(mod) ⇒ Object



43
44
45
# File 'lib/pione/test-helper.rb', line 43

def self.scope_of(mod)
  eval(mod.name.split("::").reverse.drop(1).reverse.join("::"))
end