summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/ast/definition.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fixing #2596 - Node, Class, Definition are not ASTLuke Kanies2009-12-091-213/+0
| | | | | | | | | | | | | | | | | This commit extracts these three classes into a single ResourceType class in the Parser heirarchy, now completely independent of the AST heirarchy. Most of the other changes are just changing the interface to the new class, which is greatly simplified over the previous classes. This opens up the possibility of drastically simplifying a lot of this other code, too -- in particular, replacing the reference to the parser with a reference to the (soon to be renamed) LoadedCode class. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing ruby warning in definition testLuke Kanies2009-08-021-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Implement node matching with regexesBrice Figureau2009-08-011-0/+18
| | | | | | | This patch enhance AST::HostName to support regexes, and modifies the parser to allow regex to be used as node name. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>]
* 'rake' within the spec dir works now, anyway, which isLuke Kanies2008-02-121-4/+4
| | | | a good start. Autotest still doesn't work, though.
* Moving the ast node tests to rspec (which I could haveLuke Kanies2008-02-121-0/+148
| | | | | | | *sworn* I did this weekend). In the process, I fixed a couple of bugs related to differentiating between nodes and classes, and then cleaned up quite a few error messages.
* Changing the name of the Compile class to Compiler,Luke Kanies2008-02-111-2/+2
| | | | | since it's stupid to have a class named after a verb.
* More AST refactoring -- each of the code wrapping classesLuke Kanies2008-02-081-1/+1
| | | | | | | | | | | just returns a resource from its evaluate() method, and all of the work is done in the evaluate_code method. This makes the code cleaner, because it means 1) evaluate() has the same prototype as all of the other AST classes, 2) evaluate() is no longer called indirectly through the Parser Resource class, and 3) the classes themselves are responsible for creating the resources, rather than it being done in the Compile class.
* Refactoring the AST classes just a bit. I realized thatLuke Kanies2008-02-081-3/+3
| | | | | | all of the evaluate() methods only ever accepted a scope, and sometimes one other option, so I switched them all to use named arguments instead of a hash.
* Adding this test stub that's been sittingLuke Kanies2007-10-181-0/+47
around in my repository for a while.