Discussion:
Mocking on a spawned process.
Alan Morán
2013-09-07 04:49:53 UTC
Permalink
Hi everyone,
Im trying to test drive a command line application that will have prompt
interaction and will talk via fog to aws.
The thing is that i want to test directly by spawning a process with the
system call to the command line application for acceptance tests.
This means that even when i do Fog.mock! i wont be shareing this resource,
because it wont be mocking fog on the fork process that is running the app.
Does anyone have an opinion on how i could resolve this?

Thanks,

Alan Moran
@bonzofenix
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Lee Jones
2013-09-07 18:08:37 UTC
Permalink
Hi Alan,

Maybe you could add an option to your command line application that
triggers a call to `Fog.mock!`. For example, you could add a `--mock`
option and pass it in during your tests:

my-aws-cli-app --mock

I hope that helps.

Peace,
Lee
Post by Alan Morán
Hi everyone,
Im trying to test drive a command line application that will have prompt
interaction and will talk via fog to aws.
The thing is that i want to test directly by spawning a process with the
system call to the command line application for acceptance tests.
This means that even when i do Fog.mock! i wont be shareing this resource,
because it wont be mocking fog on the fork process that is running the app.
Does anyone have an opinion on how i could resolve this?
Thanks,
Alan Moran
@bonzofenix
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-09-08 15:43:30 UTC
Permalink
Another option is to use environment variables, so ENV['FOG_MOCK'] or
similar. That way it should be the same, even in other processes.
Post by Lee Jones
Hi Alan,
Maybe you could add an option to your command line application that
triggers a call to `Fog.mock!`. For example, you could add a `--mock`
my-aws-cli-app --mock
I hope that helps.
Peace,
Lee
Post by Alan Morán
Hi everyone,
Im trying to test drive a command line application that will have prompt
interaction and will talk via fog to aws.
The thing is that i want to test directly by spawning a process with the
system call to the command line application for acceptance tests.
This means that even when i do Fog.mock! i wont be shareing this
resource, because it wont be mocking fog on the fork process that is
running the app.
Does anyone have an opinion on how i could resolve this?
Thanks,
Alan Moran
@bonzofenix
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...