Ok, so here’s the scenario. I have a top-level module, with a method
load_file. It should take a file name, get the YAML module (Syck) to
it, and then send the result to a class, which should convert that
into a series of objects.
I’m not sure what specs, if any, I should write for load_file. I can get
into the nitty gritty details of exactly what methods it should be
but that seems brittle. I can skip all that and just make assertions
the final series of objects, but I’d rather put those specs on the class
that’s actually doing the conversion.
Suggestions? Here’s the code that I (think I) want to drive out:
def self.load_file file_name
raw = YAML::load_file file_name
tree = BehaviorTreeCreator.new(raw).create