Class: Goku::Elements::Spec

Inherits:
Base
  • Object
show all
Defined in:
lib/goku/elements/spec.rb

Instance Attribute Summary

Attributes inherited from Base

#elements, #name

Instance Method Summary collapse

Methods inherited from Base

#add

Constructor Details

#initialize(name, ancestor_names) ⇒ Spec

Returns a new instance of Spec.



5
6
7
8
9
# File 'lib/goku/elements/spec.rb', line 5

def initialize(name, ancestor_names)
  super(name)

  @ancestor_names = ancestor_names
end

Instance Method Details

#to_sObject



11
12
13
14
15
# File 'lib/goku/elements/spec.rb', line 11

def to_s
  full_name = (@ancestor_names + [name]).map(&:camelcase).join("::")

  "require \"spec_helper\"\n\ndescribe #{full_name} do\n#{super}\nend"
end