# RSpec

**URL:** https://www.ruby-forum.com/c/testing/rspec/25.md?page=80

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 81

---

## [How to kill a running spec](https://www.ruby-forum.com/t/how-to-kill-a-running-spec/153411)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 7\
**Last updated:** [November 16, 2008, 11:57pm UTC](https://www.ruby-forum.com/t/how-to-kill-a-running-spec/153411 "2008-11-16T23:57:34Z")

</div>

Hi guys. Occasionally, I’ll want to kill a long spec process that’s running. Usually I hit CTRL+c to kill a running process, but doing that for a running spec just causes “^C” to be printed to the terminal, and whiche…

---

## [How to spec a (Trollop-based) binary â€™s internal state?](https://www.ruby-forum.com/t/how-to-spec-a-trollop-based-binary-a-s-internal-state/152795)

<div class="topic-metadata">

**Author:** [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Replies:** 6\
**Last updated:** [November 15, 2008, 12:00pm UTC](https://www.ruby-forum.com/t/how-to-spec-a-trollop-based-binary-a-s-internal-state/152795 "2008-11-15T12:00:00Z")

</div>

Iâ€™m trying to spec a â€˜binaryâ€™, and as previously discussed on this list, Iâ€™m trying to do it â€˜from outsideâ€™ â€“ i.e., by calling it with Kernel#\` and observing the (side-)effects. Unfortunately, this doesn…

---

## [Learning Cucumber](https://www.ruby-forum.com/t/learning-cucumber/153230)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 4\
**Last updated:** [November 15, 2008, 2:35am UTC](https://www.ruby-forum.com/t/learning-cucumber/153230 "2008-11-15T02:35:39Z")

</div>

Here is the scenario: Scenario: Create a new entity row Given I am on the new entity page When I fill in a textbox labelled “Common Name” with “My New Entity” And I fill in a textbox labelled “Full Legal Name:” with …

---

## [Webrat cannot find label?](https://www.ruby-forum.com/t/webrat-cannot-find-label/153239)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 13\
**Last updated:** [November 14, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/webrat-cannot-find-label/153239 "2008-11-14T19:55:44Z")

</div>

Cucumber 0.1.9, Rails 2.2.0RC1, Ruby 1.8.6, Webrat… etc. Here is the scenario: Scenario: Attempt to ADD a VALID entity Given I am on the new entity page When I fill in “Common Name” with “My Common Name” And I to s…

---

## [Skipped steps running stealthily](https://www.ruby-forum.com/t/skipped-steps-running-stealthily/153235)

<div class="topic-metadata">

**Author:** [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Replies:** 2\
**Last updated:** [November 14, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/skipped-steps-running-stealthily/153235 "2008-11-14T18:41:47Z")

</div>

I’ve just noticed that my “skipped” steps are actually running, but their errors are being swallowed. They can print to the screen, however. Is that intentional? It’s certainly not what I was expecting. I assumed …

---

## [Selecting a date with Webrat](https://www.ruby-forum.com/t/selecting-a-date-with-webrat/153240)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 5\
**Last updated:** [November 14, 2008, 5:50am UTC](https://www.ruby-forum.com/t/selecting-a-date-with-webrat/153240 "2008-11-14T05:50:29Z")

</div>

Hi, I’m writing a scenario that needs to select date values from a form created with Rails’ form\_for() method, and I’m looking for a clean way to do that by specifying only the label (in this case “Date”), rather tha…

---

## [Cucumber: The Mysteries of Before(), After(), World() etc](https://www.ruby-forum.com/t/cucumber-the-mysteries-of-before-after-world-etc/153125)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 7\
**Last updated:** [November 13, 2008, 5:06pm UTC](https://www.ruby-forum.com/t/cucumber-the-mysteries-of-before-after-world-etc/153125 "2008-11-13T17:06:58Z")

</div>

My use case is that I want to be able to use a Logging::Logger\[1\] within my scenario code. I can create the logger explicitly within the step block, but this is a hackaround. I think I could monkey-patch Cucumber::Ra…

---

## [.with(:anything) issue](https://www.ruby-forum.com/t/with-anything-issue/153212)

<div class="topic-metadata">

**Author:** [@epirsch](https://www.ruby-forum.com/u/epirsch)\
**Replies:** 6\
**Last updated:** [November 13, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/with-anything-issue/153212 "2008-11-13T14:47:18Z")

</div>

Hi, I’m using a expectation like this : repository.should\_receive(:add\_gem).with(“test.txt”, :anything) When I run my spec, it fails with the following message : Spec::Mocks::MockExpectationError in ‘MiniGemServer sh…

---

## [Cucumber Scaffolds](https://www.ruby-forum.com/t/cucumber-scaffolds/153148)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 9\
**Last updated:** [November 13, 2008, 2:17pm UTC](https://www.ruby-forum.com/t/cucumber-scaffolds/153148 "2008-11-13T14:17:48Z")

</div>

I have installed all of the various bit and pieces for rspec and cucumber and have used: script/generate feature Frooble name color description To create a dummy feature and related steps. Now, while I have been po…

---

## [Autotest style autotest/rails\_rspec doesn't seem to exist. Aborting](https://www.ruby-forum.com/t/autotest-style-autotest-rails-rspec-doesnt-seem-to-exist-aborting/153202)

<div class="topic-metadata">

**Author:** [@ramontayag](https://www.ruby-forum.com/u/ramontayag)\
**Replies:** 0\
**Last updated:** [November 13, 2008, 12:15pm UTC](https://www.ruby-forum.com/t/autotest-style-autotest-rails-rspec-doesnt-seem-to-exist-aborting/153202 "2008-11-13T12:15:43Z")

</div>

Just upgraded my rspec because I wanted to start using cucumber. Autotest stopped working though. I got the error shown in the subject: “Autotest style autotest/rails\_rspec doesn’t seem to exist. Aborting.” What sho…

---

## [Specing based on user roles](https://www.ruby-forum.com/t/specing-based-on-user-roles/152700)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 12\
**Last updated:** [November 13, 2008, 1:13am UTC](https://www.ruby-forum.com/t/specing-based-on-user-roles/152700 "2008-11-13T01:13:12Z")

</div>

On my website each user can have the following roles: Not logged in Logged in active administrator sysadministrator How would you write DRY specs to test each action of a controller? Currently I am doing some…

---

## [Mixing in spec helper methods](https://www.ruby-forum.com/t/mixing-in-spec-helper-methods/153090)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 9\
**Last updated:** [November 12, 2008, 10:38pm UTC](https://www.ruby-forum.com/t/mixing-in-spec-helper-methods/153090 "2008-11-12T22:38:38Z")

</div>

I’ve written a module for my specs that contains a helper method, and am mixing the module into my specs with #include . It seems that the method must be called with an #it block. If it isn’t, this error occurs: … in m…

---

## [Warning: cucumber and spec generators on rails 2.1.0](https://www.ruby-forum.com/t/warning-cucumber-and-spec-generators-on-rails-2-1-0/153152)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 2\
**Last updated:** [November 12, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/warning-cucumber-and-spec-generators-on-rails-2-1-0/153152 "2008-11-12T20:55:41Z")

</div>

hey there, I’ve come back to one Rails 2.1.0 project and notice that using ruby script/generate rspec (or the cucumber one) produces this warning: Warning: Gem::SourceIndex#search support for Regexp patterns is dep…

---

## [Cucumber feature checking sort order of list](https://www.ruby-forum.com/t/cucumber-feature-checking-sort-order-of-list/153135)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 9\
**Last updated:** [November 12, 2008, 8:06pm UTC](https://www.ruby-forum.com/t/cucumber-feature-checking-sort-order-of-list/153135 "2008-11-12T20:06:19Z")

</div>

hi there, I would like to assure in my scenario that the list shown is in the correct order (e.g. ASC or DESC). I can spec that but I feel it would be more client-oriented if I could do it in the feature… any ideas…

---

## [Correct way to spec partials](https://www.ruby-forum.com/t/correct-way-to-spec-partials/151658)

<div class="topic-metadata">

**Author:** [@Oleksandr\_R](https://www.ruby-forum.com/u/Oleksandr_R)\
**Replies:** 4\
**Last updated:** [November 12, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/correct-way-to-spec-partials/151658 "2008-11-12T19:02:17Z")

</div>

Hi everybody, Does anybody have full working example of how to test partial templates? What the correct place to test partials: controller or view spec? If controller correct place, should I use integrate\_views? …

---

## [ANN Cucumber 0.1.9](https://www.ruby-forum.com/t/ann-cucumber-0-1-9/153144)

<div class="topic-metadata">

**Author:** [@aslak\_hellesoy](https://www.ruby-forum.com/u/aslak_hellesoy)\
**Replies:** 0\
**Last updated:** [November 12, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/ann-cucumber-0-1-9/153144 "2008-11-12T16:54:21Z")

</div>

I’m pleased to announce Cucumber 0.1.9 - full changelog here: http://github.com/aslakhellesoy/cucumber/tree/v0.1.9/History.txt gem install cucumber (As usual, the gem will take a few hours to rsync around the world). …

---

## [Is this a bug?](https://www.ruby-forum.com/t/is-this-a-bug/153099)

<div class="topic-metadata">

**Author:** [@Richard\_Lloyd](https://www.ruby-forum.com/u/Richard_Lloyd)\
**Replies:** 1\
**Last updated:** [November 12, 2008, 6:27am UTC](https://www.ruby-forum.com/t/is-this-a-bug/153099 "2008-11-12T06:27:46Z")

</div>

I’m new to rspec and, of course, my first time out and I’m tripped up by what appears to me to be a bug. A simple demonstration: script/generate rspec\_scaffold GoodDocument title:string body:text From spec/views/goo…

---

## [What triggers "./script/autospec" to kick in? when I change my model it doesn't always retest](https://www.ruby-forum.com/t/what-triggers-script-autospec-to-kick-in-when-i-change-my-model-it-doesnt-always-retest/153085)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 5\
**Last updated:** [November 12, 2008, 3:01am UTC](https://www.ruby-forum.com/t/what-triggers-script-autospec-to-kick-in-when-i-change-my-model-it-doesnt-always-retest/153085 "2008-11-12T03:01:19Z")

</div>

Hi, Does anyone know what exactly trigger autospec to rerun tests? I ask as I have a model file that has spec tests for it, but I’ve noticed when I fix the line in the model file it’s not automatically retriggering a…

---

## [Installing rspec, cucumber, et al](https://www.ruby-forum.com/t/installing-rspec-cucumber-et-al/153073)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 8\
**Last updated:** [November 11, 2008, 10:58pm UTC](https://www.ruby-forum.com/t/installing-rspec-cucumber-et-al/153073 "2008-11-11T22:58:53Z")

</div>

I have a project that I am returning to after some time away on other issues. When last I worked on it I had rspec and rspec for rails installed as git submodules but I recall that I also had to have rspec installed …

---

## [Specs for authorisation](https://www.ruby-forum.com/t/specs-for-authorisation/152991)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 2\
**Last updated:** [November 11, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/specs-for-authorisation/152991 "2008-11-11T15:36:53Z")

</div>

I’m writing specs to check that certain user types are authorised to access certain controller actions. In addition to writing specs for authorised user types and for users who aren’t logged-in, I feel that I should w…

---

## [How to expect no layout](https://www.ruby-forum.com/t/how-to-expect-no-layout/153007)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 3\
**Last updated:** [November 11, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/how-to-expect-no-layout/153007 "2008-11-11T15:22:47Z")

</div>

Hey guys. I’ve told one of my controllers to not render a layout for a certain action: layout false, :only =\> :map\_info\_window Now I’m trying to spec that, but this: it ‘should not render a layout’ do controller.exp…

---

## [Any way to have a different SOUND from growl for a 'pass' rather than a 'fail' when using "./script/](https://www.ruby-forum.com/t/any-way-to-have-a-different-sound-from-growl-for-a-pass-rather-than-a-fail-when-using-script/152882)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 4\
**Last updated:** [November 11, 2008, 11:27am UTC](https://www.ruby-forum.com/t/any-way-to-have-a-different-sound-from-growl-for-a-pass-rather-than-a-fail-when-using-script/152882 "2008-11-11T11:27:09Z")

</div>

Hi, Is there any way to have a different SOUND from growl for a ‘pass’ rather than a ‘fail’ when using “./script/autospec” ??? thanks

---

## [Running an entire #describe block](https://www.ruby-forum.com/t/running-an-entire-describe-block/152977)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 4\
**Last updated:** [November 10, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/running-an-entire-describe-block/152977 "2008-11-10T23:56:37Z")

</div>

I know that it’s possible to run a single spec example (IE: #it block) with the -e option for script/spec . Is it possible to run an entire context (IE: #describe block)? Cheers, Nick

---

## [Any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?](https://www.ruby-forum.com/t/any-tricks-re-using-eql-5-5-but-where-5-5-is-a-decimal-not-float/152843)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 15\
**Last updated:** [November 10, 2008, 1:23am UTC](https://www.ruby-forum.com/t/any-tricks-re-using-eql-5-5-but-where-5-5-is-a-decimal-not-float/152843 "2008-11-10T01:23:27Z")

</div>

– Sent from my mobile device

---

## [A smarter autospec?](https://www.ruby-forum.com/t/a-smarter-autospec/152911)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 7\
**Last updated:** [November 9, 2008, 9:09pm UTC](https://www.ruby-forum.com/t/a-smarter-autospec/152911 "2008-11-09T21:09:40Z")

</div>

Let’s say I change a method in one of my models in a Rails app. I hit save: autospec kicks in and starts specing. But I haven’t yet edited my spec(s) to the new method name so the specs will obviously fail, but I alre…

---

## [\[Cucumber\] The User Story File](https://www.ruby-forum.com/t/cucumber-the-user-story-file/152801)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 16\
**Last updated:** [November 9, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/cucumber-the-user-story-file/152801 "2008-11-09T17:57:43Z")

</div>

Hi, The customer is not happy about writing Stories in a text editor. Has anyone else experienced this? Is anyone using a wiki, spreadsheet, or word document and automatically converting to a text file? Thanks Aidy

---

## [TextMate File Type Detection for RSpec & Rails](https://www.ruby-forum.com/t/textmate-file-type-detection-for-rspec-rails/117302)

<div class="topic-metadata">

**Author:** [@carlpulley](https://www.ruby-forum.com/u/carlpulley)\
**Replies:** 1\
**Last updated:** [November 9, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/textmate-file-type-detection-for-rspec-rails/117302 "2008-11-09T15:53:27Z")

</div>

For those of you struggling with TextMate not properly detecting rspec files, Allan Odgaard (the author of TextMate) has kindly provided a tutorial on how to set up TextMate to associate all .rb files with rails and a…

---

## [Sharing the little dialects we write in Cucumber](https://www.ruby-forum.com/t/sharing-the-little-dialects-we-write-in-cucumber/152859)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 3\
**Last updated:** [November 8, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/sharing-the-little-dialects-we-write-in-cucumber/152859 "2008-11-08T15:20:22Z")

</div>

The common\_webrat.rb steps file that comes with cucumber when you add it to rails really inspired our team. We’ve extended it a fair bit to do various other things to check the content of a page such as \[1\] which enab…

---

## [Should\_raise ain't workin' with the \`spec\` command](https://www.ruby-forum.com/t/should-raise-aint-workin-with-the-spec-command/152851)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 4\
**Last updated:** [November 8, 2008, 10:10am UTC](https://www.ruby-forum.com/t/should-raise-aint-workin-with-the-spec-command/152851 "2008-11-08T10:10:00Z")

</div>

Hello my fellow RSpeckers, I am using the spec command like this: spec tokyo\_record\_spec.rb And the for some reason the should\_raise Rspec command is not happening with my lambda block: it "should raise …

---

## [Confusion At Failing Specs](https://www.ruby-forum.com/t/confusion-at-failing-specs/152836)

<div class="topic-metadata">

**Author:** [@rsl](https://www.ruby-forum.com/u/rsl)\
**Replies:** 5\
**Last updated:** [November 8, 2008, 2:35am UTC](https://www.ruby-forum.com/t/confusion-at-failing-specs/152836 "2008-11-08T02:35:03Z")

</div>

Can someone please explain to me why this spec fails it “should work” do template.stub!(:render) template.should\_receive(:render).with(:partial =\> “foo”) render @template\_with\_render\_partial\_foo end but this spec p…

[Previous page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=79)

[Next page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=81)
