refactor: factor run_example out of runner.run_examples.

* lib/specl/runner.lua (run_example): New function.  Factored
out...
(run_examples): ...of this.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
travis: regenerate .travis.yml for latest luarocks stable.

* .travis.yml: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: support programmatic `it` calls.

* specs/formatter/report_spec.yaml (with passing 'it' expectation)
(with failing 'it' expectation): Specify behaviour of programmatic
`it` calls.
* lib/specl/runner.lua (run_examples): Inject `it` implementation
into the function execution environment.
* doc/specl.md (Programmatic Specifications): Document idiomatic
use of `it` calls.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: expand macros when loading from spec directories.

* lib/specl/std.lua (io.writelines): Copy from upstream stdlib.
* specs/spec_helper.lua: Set randomseed for tmp directory name
randomisation.
(TMPDIR): Set to environment TMPDIR or TMP or fall back to /tmp
if all else fails.
(append): Factored out of Tmpfile.
(Tmpfile): Adjust _init function to accept an optional path and
zero or more lines to write to the file.
(append): Simplify using std.io.writelines.
(Tmpdir): New object.  Manage a directory of Tmpfile objects.
* specs/specl_spec.yaml: Adjust Tmpfile calls accordingly.
* specs/loader_spec.yaml: New file. Specify loading behaviours.
* specs/specs.mk (specl_SPECS): Add specs/loader_spec.yaml.
* lib/specl/loader.lua (spec_path): Track spec-file directories.
(expandmacros): New searcher for `package.loaders` that runs
loaded source files from `spec_path` through
`macro.substitute_string` with `expect` macro already defined.
(Parser.preamble): Use it when autoloading `spec_helper.lua`.
* lib/specl/runner.lua (run_examples): When running an example
from the function environment definition of `it`, set the line
number of the definition to "unknown" if we don't have a line
number from the YAML parser.
* doc/specl.md (Programmatic Specifications): Document it.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: generalize `it` into `examples` for programmatic specs.

* specs/runner_spec.yaml: New file.  Exercise examples syntax.
* specs/specs.mk (specl_SPECS): Add specs/runner_spec.yaml.
* lib/specl/runner.lua (run_examples): Remove `it` from function
environment.
Add new `examples` definition to function environment.
* specs/formatter/report_spec.yaml, specs/loader_spec.yaml:
Update accordingly.
* doc/specl.md (Programmatic Specifications): Likewise.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: don't cache loaded module dependencies.

* lib/specl/loader.lua: Remove yaml and lyaml handles from the
loaded module cache.  We still have a handle for internal use,
and now the spec-files in the lyaml project check the in-tree
module behaviours rather than picking up Specl's already loaded
version from the install tree.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>