Re: [foreman-dev] Re: external_node_v2 refactor!

2016-07-21 Thread Marek Hulán
Hello

I don't think there's too much functionality in this script. Maybe a unit test 
for what's worth of testing would be enough? In such case I'd recommend using 
minitest. It has some stubbing built-in but maybe webmock [1] might be useful 
for stubbing out communication with Foreman.

[1] https://github.com/bblimke/webmock

--
Marek

On Thursday 21 of July 2016 01:50:02 otheus uibk wrote:
> Having written being in favor of Cucumber / Aruba, I do have doubts about
> it: the documentation is severely lacking, and while I finally found a
> decent guide, it's not clear to me using this will provide the tactical
> advantage I hoped for.
> 
> On Thursday, July 21, 2016 at 2:54:09 AM UTC+2, otheus uibk wrote:
> > The critical nature of node.rb has taken me down the rabbit hole of
> > functional development, which in the ruby/puppet world means rspec. But in
> > order to refactor properly, what I really need here is to test the
> > behavior
> > of the script _as an executable_. The current rspec file does unit testing
> > on some of the internal methods of that file, treated as a module. Some
> > googling brought me to the ARUBA project, which is a sub project of
> > cucumber. I'm very keen on the whole BDD cycle in general, but
> > unfortunately, the *style* of documentation of that project makes it very
> > difficult for me to proceed. It's clear that if I were to test
> > external_node_v2.rb using cucumber/aruba, I will need to add quite a few
> > files and it's a lot of work. Which I don't mind doing. But before I
> > proceed, I ask: Are there objections to using cucumber / aruba within this
> > project? Are there alternatives for testing a program as a black box? (In
> > our case, the testing harness will need to start a temporary HTTP service
> > to provide test files, in lieu of an ability to set up a mock).

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[foreman-dev] Re: external_node_v2 refactor!

2016-07-21 Thread otheus uibk
Having written being in favor of Cucumber / Aruba, I do have doubts about 
it: the documentation is severely lacking, and while I finally found a 
decent guide, it's not clear to me using this will provide the tactical 
advantage I hoped for. 

On Thursday, July 21, 2016 at 2:54:09 AM UTC+2, otheus uibk wrote:
>
> The critical nature of node.rb has taken me down the rabbit hole of 
> functional development, which in the ruby/puppet world means rspec. But in 
> order to refactor properly, what I really need here is to test the behavior 
> of the script _as an executable_. The current rspec file does unit testing 
> on some of the internal methods of that file, treated as a module. Some 
> googling brought me to the ARUBA project, which is a sub project of 
> cucumber. I'm very keen on the whole BDD cycle in general, but 
> unfortunately, the *style* of documentation of that project makes it very 
> difficult for me to proceed. It's clear that if I were to test 
> external_node_v2.rb using cucumber/aruba, I will need to add quite a few 
> files and it's a lot of work. Which I don't mind doing. But before I 
> proceed, I ask: Are there objections to using cucumber / aruba within this 
> project? Are there alternatives for testing a program as a black box? (In 
> our case, the testing harness will need to start a temporary HTTP service 
> to provide test files, in lieu of an ability to set up a mock). 
>

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.