# Newbie cucumber tutorial

**URL:** <https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182>\
**Category:** RSpec\
**Created:** [December 22, 2008, 10:01am UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182 "2008-12-22T10:01:45Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![sackerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Post date:** [December 24, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182/21 "2008-12-24T16:27:22Z")

</div>

On Wed, Dec 24, 2008 at 1:32 AM, Matt W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is that some kind of trick to create multiple
> 
> > inheritance?
> 
> Not really in that particular case. Ruby modules generally allow you to do  
> multiple inheritance by ‘mixing in’ behaviour to classes, but that would be  
> when you use ‘include’ to bring the methods defined in the module into the  
> class itself.

When you inherit from a class, you inherit both its instance methods and  
its  
class methods. When you include a module, you (usually) just inherit its  
instance methods. The trick under discussion just makes sure you inherit  
the  
modules “class methods” as well, making it as if you inherited normally.

Is there any way without digging thru source to know which

> class include methods from other classes or do y’all just get so cozy  
> with every Rails class you use that you “just know?”

ancestors tells you a class’s superclasses (including modules).

///ark

---

<div class="post-metadata">

**Author:** ![sackerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Post date:** [November 16, 2011, 6:34pm UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182/22 "2011-11-16T18:34:49Z")

</div>

I’m new with Ruby and Cucumber. I’ve tried this simple test, but it  
didn’t work for me

Given …  
When I enter ABC on keyboard  
Then …

And here is the ruby code  
When /^I enter “([^”]\*) on keyboard$/ do |input|  
…  
end

I always get a complain when executing the test  
"You can implement step definitions for undefined steps with there  
snippets:

When /^I enter ABC on keyboard$/ do  
pending # express the regexp above with the code you wish you had  
end  
"

And the code above was not executed.

Can anyone tell what I’ve done wrong here?

Thanks.

---

<div class="post-metadata">

**Author:** ![sackerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Post date:** [November 16, 2011, 7:32pm UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182/23 "2011-11-16T19:32:25Z")

</div>

On Nov 16, 2011, at 11:34 AM, Vin MR wrote:

> I’m new with Ruby and Cucumber. I’ve tried this simple test, but it  
> didn’t work for me

Please send this to the Cucumber mailing list:

> **[Cukes - Google Groups](https://groups.google.com/g/cukes)**

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![sackerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Post date:** [November 16, 2011, 7:36pm UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182/24 "2011-11-16T19:36:08Z")

</div>

On Wed, Nov 16, 2011 at 5:34 PM, Vin MR [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m new with Ruby and Cucumber. I’ve tried this simple test, but it  
> didn’t work for me
> 
> Given …  
> When I enter ABC on keyboard  
> Then …
> 
> And here is the ruby code  
> When /^I enter "([^"]\*) on keyboard$/ do |input|

That RegExp doesn’t match your step. This will match:

/^I enter (.\*) on keyboard$/

Aslak

---

<div class="post-metadata">

**Author:** ![sackerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Post date:** [November 16, 2011, 6:49pm UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182/25 "2011-11-16T18:49:43Z")

</div>

this group is for rspec

---

<div class="post-metadata">

**Author:** ![sackerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Post date:** [November 16, 2011, 10:12pm UTC](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182/26 "2011-11-16T22:12:10Z")

</div>

On Wed, Nov 16, 2011 at 5:45 PM, Chris H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> this group is for rspec

The Cucumber list → [http://groups.google.com/group/cukes](http://groups.google.com/group/cukes)

[Previous page](https://www.ruby-forum.com/t/newbie-cucumber-tutorial/156182.md?page=1)
