# Cucumber - stub! or mock?

**URL:** <https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646>\
**Category:** RSpec\
**Created:** [September 15, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646 "2008-09-15T22:14:51Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [September 30, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/21 "2008-09-30T21:57:08Z")

</div>

On Sep 30, 2008, at 10:55 AM, Luke M. wrote:

> We need to stub time in some of our scenarios, which exist to to  
> verify behavior over time. We’re looking into a before/after to  
> support mocking/stubbing for this scenario.

Thanks for everyone’s thoughts. I understand that mocks are generally  
an anathema to story tests. We’ve decided to use them to solve this  
particular problem, though, and rely on our own self-discipline to not  
abuse their presence. Here’s what we’re going with for now in our  
env.rb:

require ‘spec/mocks’  
require File.expand\_path(File.join(File.dirname( **FILE** ), “..”, “..”,  
“vendor”, “plugins”, “rspec”, “plugins”, “mock\_frameworks”, “rspec”))  
include Spec::Plugins::MockFramework

Before do  
setup\_mocks\_for\_rspec  
end

After do  
begin  
verify\_mocks\_for\_rspec  
ensure  
teardown\_mocks\_for\_rspec  
end  
end

## Luke

Luke M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Luke Melia](https://www.lukemelia.com/)**
>
> The personal website of Luke Melia, a vegetarian software developer from New York City who attempts to live every day with passion.

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 5:12pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/22 "2008-10-01T17:12:55Z")

</div>

On Tue, Sep 30, 2008 at 5:20 PM, aslak hellesoy  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 

That gets you whatever the latest is, which is good if you want to live  
on  
edge. I’m behind a firewall, and living on edge isn’t necessarily a  
good  
option. Would it be too much to ask if you could tag the repo when you  
jump  
to a new release, like David is doing with rspec?

Github lets you download a snapshot of the repo by tags, and I just  
build  
the gems from that, and toss them up into a behind-the-firewall gem  
server,  
and let everyone gem install from there. It’s a bit harder with  
cucumber,  
because I’m not sure where the “released, stable” point is …

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/23 "2008-10-01T17:21:43Z")

</div>

On Wed, Oct 1, 2008 at 5:11 PM, Chris F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > You can do that with git pull and git checkout. Would it help if  
> > detailed instructions were posted to the wiki?
> 
> That gets you whatever the latest is, which is good if you want to live on  
> edge. I’m behind a firewall, and living on edge isn’t necessarily a good  
> option.

Have you tried this?

export http\_proxy=[http://yourproxy](http://yourproxy):yourport  
git clone [http://github.com/aslakhellesoy/cucumber](http://github.com/aslakhellesoy/cucumber)

git checkout SHA-of-the-rev-you-want

> Would it be too much to ask if you could tag the repo when you jump  
> to a new release, like David is doing with rspec?

Absolutely - I’ll tag it when there is a release. And push a gem to  
RubyForge. But there hasn’t been one yet.

> Github lets you download a snapshot of the repo by tags, and I just build  
> the gems from that, and toss them up into a behind-the-firewall gem server,  
> and let everyone gem install from there. It’s a bit harder with cucumber,  
> because I’m not sure where the “released, stable” point is …

It’s whenever I feel like it and have some spare time 🙂 Probably  
within the next week or so.

Aslak

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 5:31pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/24 "2008-10-01T17:31:43Z")

</div>

On Wed, Oct 1, 2008 at 11:20 AM, aslak hellesoy  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> > > > number.  
> > > > Have you tried this?
> 
> export http\_proxy=[http://yourproxy](http://yourproxy):yourport  
> git clone [http://github.com/aslakhellesoy/cucumber](http://github.com/aslakhellesoy/cucumber)
> 
> git checkout SHA-of-the-rev-you-want

That’d work if I had git on the windows machine that can actually access  
the  
internet. Unfortunately, I don’t, and I won’t. It’s pretty tightly  
locked  
down. “firewall” is a bad term, because it implies there’s an actual  
path  
to the internet. There isn’t, at least not from the place I do actual  
work. Have to burn files and copy them. Virus paranoia and such.

… yes, it’s a pain in the ass.

> > Would it be too much to ask if you could tag the repo when you jump  
> > to a new release, like David is doing with rspec?
> 
> Absolutely - I’ll tag it when there is a release. And push a gem to  
> RubyForge. But there hasn’t been one yet.

Ah. I’d been going on the assumption that the occasional gem version  
bumps  
were signifying real checkpoints. If not, then, I havn’t yet been  
burned by  
pulling down head once a week or so

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/25 "2008-10-01T17:54:38Z")

</div>

On Wed, Oct 1, 2008 at 5:30 PM, Chris F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > On Tue, Sep 30, 2008 at 9:02 PM, Evan David L.
> > 
> > git checkout SHA-of-the-rev-you-want
> 
> That’d work if I had git on the windows machine that can actually access the  
> internet. Unfortunately, I don’t, and I won’t. It’s pretty tightly locked  
> down. “firewall” is a bad term, because it implies there’s an actual path  
> to the internet. There isn’t, at least not from the place I do actual  
> work. Have to burn files and copy them. Virus paranoia and such.
> 
> … yes, it’s a pain in the ass.

I can feel your pain. I have worked for this kind of clients.  
Insurance and government. They don’t seem to understand how big an  
impediment this is. And that people who need to work around this (us)  
will do it anyway to get work done. It’s just stupid.

> pulling down head once a week or so  
> No, actually - it’s been me trying to convince the GitHub pixies to  
> build the gem. To no avail.

Aslak

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/26 "2008-10-01T18:06:25Z")

</div>

On Oct 1, 2008, at 11:53 AM, aslak hellesoy wrote:

> No, actually - it’s been me trying to convince the GitHub pixies to  
> build the gem. To no avail.

Not to belabor a point overly but hence my suggestion to put a gem on  
RubyForge.

I’m dying for a stable version of Cucumber – even if it’s only  
“stable” 😉

Evan

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 6:39pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/27 "2008-10-01T18:39:50Z")

</div>

On Oct 1, 2008, at 12:09 PM, Ashley M. wrote:

> On 1 Oct 2008, at 16:53, aslak hellesoy wrote:
> 
> > No, actually - it’s been me trying to convince the GitHub pixies to  
> > build the gem. To no avail.
> 
> Have we witnessed the birth of Pixie Driven Development this week?  
> I feel like we need PixieSpec and Pixie Stories next 🙂

No, I think it’s a matter of “GitHub Driven Deployment” – or non-  
Deployment as the case would be. :-/

Evan

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/28 "2008-10-01T18:09:56Z")

</div>

On 1 Oct 2008, at 16:53, aslak hellesoy wrote:

> No, actually - it’s been me trying to convince the GitHub pixies to  
> build the gem. To no avail.

Have we witnessed the birth of Pixie Driven Development this week? I  
feel like we need PixieSpec and Pixie Stories next 🙂

Ashley

–

> **[PatchSpace](http://www.patchspace.co.uk/)**

> **[影视资源聚合平台](http://www.aviewfromafar.net/)**
>
> 为您提供高清电影、电视剧、动漫和综艺内容，支持在线观看与内容筛选。

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/29 "2008-10-01T19:31:33Z")

</div>

On Wed, Oct 1, 2008 at 12:30 PM, Chris F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > On Tue, Sep 30, 2008 at 9:02 PM, Evan David L.
> > 
> > git checkout SHA-of-the-rev-you-want
> 
> That’d work if I had git on the windows machine that can actually access the  
> internet. Unfortunately, I don’t, and I won’t. It’s pretty tightly locked  
> down. “firewall” is a bad term, because it implies there’s an actual path  
> to the internet. There isn’t, at least not from the place I do actual  
> work. Have to burn files and copy them. Virus paranoia and such.
> 
> … yes, it’s a pain in the ass.

I hear ya brother, same here, luckily not anymore.

you can do the following (at home):

gem search cucumber --remote --source [http://gems.github.com](http://gems.github.com)

gem fetch cucumber --source [http://gems.github.com](http://gems.github.com)

This will put the .gem file in the folder you performed the task for  
you to easily copy to your locked down environment 😃

> pulling down head once a week or so  
> Github gems are only updated when the cucumber.gemspec file is updated.

## – Luis L. AREA 17

Human beings, who are almost unique in having the ability to learn from  
the experience of others, are also remarkable for their apparent  
disinclination to do so.  
Douglas Adams

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 10:28pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/30 "2008-10-01T22:28:05Z")

</div>

On Oct 1, 2008, at 2:50 PM, aslak hellesoy wrote:

> Does anyone want Cucumber gems? No? Yes? Anyone? OK I HEARD YOU! 🙂
> 
> [http://rubyforge.org/frs/?group\_id=797](http://rubyforge.org/frs/?group_id=797)
> 
> Just chill till it rsyncs around. Install docs are updated:  
> [GitHub · Change is constant. GitHub keeps you ahead. · GitHub · GitHub](http://github.com/aslakhellesoy/cucumber/wikis/home)

Thank you!

---

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [October 1, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646/31 "2008-10-01T20:55:37Z")

</div>

On Wed, Oct 1, 2008 at 7:03 PM, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > > > detailed instructions were posted to the wiki?  
> > > > > git clone [http://github.com/aslakhellesoy/cucumber](http://github.com/aslakhellesoy/cucumber)
> 
> you to easily copy to your locked down environment 😃
> 
> > were signifying real checkpoints. If not, then, I havn’t yet been burned by  
> > pulling down head once a week or so
> 
> Github gems are only updated when the cucumber.gemspec file is updated.

Yes, but only in theory:

> **[Lighthouse](https://lighthouseapp.com/login?domain=logicalawesome)**

Does anyone want Cucumber gems? No? Yes? Anyone? OK I HEARD YOU! 🙂

[http://rubyforge.org/frs/?group\_id=797](http://rubyforge.org/frs/?group_id=797)

Just chill till it rsyncs around. Install docs are updated:

> **[GitHub · Change is constant. GitHub keeps you ahead. · GitHub](https://github.com/)**
>
> Join the world's most widely adopted, AI-powered developer platform where millions of developers, businesses, and the largest open source community build software that advances humanity.

Aslak

[Previous page](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646.md?page=1)
