Module: Qlive::Suite

Includes:
QunitAssets
Defined in:
lib/qlive/suite.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from QunitAssets

#glob_script_tags, #prepare_assets, #qunit_disable_autostart, #qunit_finalize, #qunit_framework, #qunit_html_structure, #qunit_javascript_test_sources, #qunit_support_assets

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



8
9
10
# File 'lib/qlive/suite.rb', line 8

def request
  @request
end

#sessionObject (readonly)

Returns the value of attribute session.



8
9
10
# File 'lib/qlive/suite.rb', line 8

def session
  @session
end

Class Method Details

.included(base) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/qlive/suite.rb', line 12

def self.included(base)
  meta = Registry.register_class(base)
  base.class_eval do
    class << self
      attr_reader :suite_meta_data
    end
  end
  base.instance_variable_set(:@suite_meta_data, meta)

  InsertionPoints.each do |place|
    attr_accessor place

    define_method "html_#{place}" do
      htmls = instance_variable_get("@#{place}")
      has_content = htmls.length > 0
      htmls.unshift "\n<!-- Begin Qlive Insertions (#{place}) -->" if has_content
      htmls << "<!-- End Qlive Insertions (#{place}) -->\n" if has_content
      htmls.join("\n")
    end
  end
end

Instance Method Details

#meta_dataObject



50
51
52
# File 'lib/qlive/suite.rb', line 50

def 
  self.class.
end

#nameObject



46
47
48
# File 'lib/qlive/suite.rb', line 46

def name
  self.[:name]
end

#prepare(args = {}) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/qlive/suite.rb', line 36

def prepare(args={})
  @session = args[:session]
  @request = args[:request]
  InsertionPoints.each do |place|
    instance_variable_set("@#{place}", [ ])
  end
  prepare_assets
end

#suite_nameObject



55
56
57
# File 'lib/qlive/suite.rb', line 55

def suite_name
  self.name
end