Method: PDQTest::Skeleton.generate_acceptance

Defined in:
lib/pdqtest/skeleton.rb

.generate_acceptance(example = nil) ⇒ Object

Scan the examples directory and create a set of acceptance tests. If a specific file is given as ‘example` then only the listed example will be processed (and it will be created if missing). If files already exist, they will not be touched



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/pdqtest/skeleton.rb', line 161

def self.generate_acceptance(example=nil)
  examples = []
  if example
    # specific file only
    examples << example
  else
    # Each .pp file in /examples (don't worry about magic markers yet, user
    # will be told on execution if no testscases are present as a reminder to
    # add it
    examples += Dir["examples/*.pp"]
  end

  examples.each { |e|
    install_acceptance(e)
  }
end