# \[Cucumber\] --dry-run

**URL:** <https://www.ruby-forum.com/t/cucumber-dry-run/159250>\
**Category:** RSpec\
**Created:** [February 2, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250 "2009-02-02T19:09:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 2, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/1 "2009-02-02T19:09:58Z")

</div>

Hi Guys,

I see in the Cucmber --help that -d akd --dry-run is supported but it  
doesn’t seem to work.

Anyone know why?

Thanks, very much.

Tim

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 2, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/2 "2009-02-02T19:14:39Z")

</div>

On Mon, Feb 2, 2009 at 7:00 PM, Tim W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Guys,
> 
> I see in the Cucmber --help that -d akd --dry-run is supported but it  
> doesn’t seem to work.
> 
> Anyone know why?

Because it has a bug that has been fixed in 0.2 prereleases (0.1.99.x)  
[http://tinyurl.com/cucumber-0-2-beta](http://tinyurl.com/cucumber-0-2-beta)

Aslak

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 3, 2009, 1:31am UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/3 "2009-02-03T01:31:01Z")

</div>

On Feb 2, 2009, at 6:30 PM, Ben G. wrote:

> ```
> ex.responses.should be_nil
> ex.responses.should_include @auth_response
> ex.responses.include?.with('a').should be_true
> 
> ```
> 
> end
> 
> Clearly, it makes no sense. Somehow the exception validation block  
> is not running. What am I doing wrong?

raise\_error doesn’t take a block, and so it’s being ignored:

[http://rspec.rubyforge.org/rspec/1.1.12/classes/Spec/Matchers.html#M000483](http://rspec.rubyforge.org/rspec/1.1.12/classes/Spec/Matchers.html#M000483)

Scott

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 3, 2009, 1:19am UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/4 "2009-02-03T01:19:53Z")

</div>

Hi all,

This spec always passes:

```
 lambda do
   process_card @credit_card, billing_info, 10604, '1.1.1.1', 

```

@gateway  
end.should raise\_error(MinimalCart::CaptureFailureError) do |ex|  
ex.should be\_nil  
ex.should\_not be\_nil  
ex.responses.should be\_nil  
ex.responses.should\_include @auth\_response  
ex.responses.include?.with(‘a’).should be\_true  
end

Clearly, it makes no sense. Somehow the exception validation block is  
not running. What am I doing wrong?

Thanks  
Ben

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 3, 2009, 2:13am UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/5 "2009-02-03T02:13:43Z")

</div>

On Mon, Feb 2, 2009 at 3:30 PM, Ben G.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> ex.responses.should_include @auth_response
> ex.responses.include?.with('a').should be_true
> 
> ```
> 
> end
> 
> Clearly, it makes no sense. Somehow the exception validation block is not  
> running. What am I doing wrong?

try using { } instead of do..end. Pretty sure that the problem you’re  
experiencing has to do with Ruby’s block precedence.

Pat

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 3, 2009, 2:07am UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/6 "2009-02-03T02:07:52Z")

</div>

On Feb 2, 2009, at 6:30 PM, Ben G. wrote:

> ```
> ex.responses.should be_nil
> ex.responses.should_include @auth_response
> ex.responses.include?.with('a').should be_true
> 
> ```
> 
> end
> 
> Clearly, it makes no sense. Somehow the exception validation block  
> is not running. What am I doing wrong?

Disregard my last email. I was being stupid.

Scott

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 4, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/7 "2009-02-04T22:08:40Z")

</div>

Hi all,

This spec always passes:

```
 lambda do
   process_card @credit_card, billing_info, 10604, '1.1.1.1', 

```

@gateway  
end.should raise\_error(MinimalCart::CaptureFailureError) do |ex|  
ex.should be\_nil  
ex.should\_not be\_nil  
ex.responses.should be\_nil  
ex.responses.should\_include @auth\_response  
ex.responses.include?.with(‘a’).should be\_true  
end

Clearly, it makes no sense. Somehow the exception validation block is  
not running. What am I doing wrong?

Thanks  
Ben

---

<div class="post-metadata">

**Author:** ![twaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a6a055/32.png) [@twaters](https://www.ruby-forum.com/u/twaters)\
**Post date:** [February 3, 2009, 2:35am UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250/8 "2009-02-03T02:35:22Z")

</div>

On Mon, Feb 2, 2009 at 4:22 PM, Pat M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > ex.should_not be_nil
> > ex.responses.should be_nil
> > ex.responses.should_include @auth_response
> > ex.responses.include?.with('a').should be_true
> > 
> > ```
> > 
> > end
> > 
> > Clearly, it makes no sense. Somehow the exception validation block is not  
> > running. What am I doing wrong?
> 
> try using { } instead of do..end. Pretty sure that the problem you’re  
> experiencing has to do with Ruby’s block precedence.

oops I should have been more specific. I meant use { } for the block  
after raise\_error:

lambda do  
process\_card @credit\_card, billing\_info, 10604, ‘1.1.1.1’, @gateway  
end.should raise\_error(MinimalCart::CaptureFailureError) { |ex|  
ex.should be\_nil  
ex.should\_not be\_nil  
ex.responses.should be\_nil  
ex.responses.should\_include @auth\_response  
ex.responses.include?.with(‘a’).should be\_true  
}

Although I think that do..end.method is hideous and so I would change  
the lambda to use curly braces as well 🙂

Pat
