Displaying 1 result from an estimated 1 matches for "each_project".
Did you mean:
arch_project
2007 Feb 07
1
advice on a spec''ing best practice
...s statement got me thinking about how i am witting my sepcs because
i have been intercepting calls to methods on the class that is being
spec''d. I do it mostly to isolate the code being tested as much as
possible.
I am hoping to get some advice on how to spec this method.
class Foo
def each_project
projects.each do|project|
yield(project, project.name)
end
end
end
projects is an attribute of class Foo. Normally i would mock the
projects attribute to return an array of mocks. That would allow me to
verify the yield is working as it should. Based on David''s comment
th...