I am using rspec/aruba to do integration tests of a command-line program i''m writing. I''d like to use something like FakeWeb to stub the network calls in the command-line program. But with aruba, the program under test runs in a separate process, and FakeWeb won''t work. I''m thinking of adding a command-line option to my program for testing, and embedding the network faking into the executable. Alternatively, I could write a local web service that delivers fake results. But I hate these solutions! I''m curious if any of you have run into this issue, and if anyone can recommend a better approach. - Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110403/ca4a687a/attachment.html>
On Mon, Apr 4, 2011 at 1:24 AM, andyl <akleak at gmail.com> wrote:> I am using rspec/aruba to do integration tests of a command-line program > i''m writing. > > ...> > Alternatively, I could write a local web service that delivers fake > results. > >I like the idea of this for end-to-end tests, depending on the complexity of the external service. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110406/466cadbd/attachment.html>
On Apr 3, 2011, at 8:24 AM, andyl wrote:> I am using rspec/aruba to do integration tests of a command-line program i''m writing. > > I''d like to use something like FakeWeb to stub the network calls in the command-line program. > > But with aruba, the program under test runs in a separate process, and FakeWeb won''t work. > > I''m thinking of adding a command-line option to my program for testing, and embedding the network faking into the executable. > > Alternatively, I could write a local web service that delivers fake results. > > But I hate these solutions! I''m curious if any of you have run into this issue, and if anyone can recommend a better approach. > > - Andy > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersAdd a second CL program that loads up the test-specific stuff and then loads the original program. Have Aruba call that instead. Pat