# RSpec

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

[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:** 120

---

## [Re: Plain Text Stories: Part III](https://www.ruby-forum.com/t/re-plain-text-stories-part-iii/118275)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 1\
**Last updated:** [October 25, 2007, 11:19am UTC](https://www.ruby-forum.com/t/re-plain-text-stories-part-iii/118275 "2007-10-25T11:19:01Z")

</div>

Step 3: Let her open the box … no, that’s not it … I’m ashamed to admit it, but I actually laughed out loud. (And, erm, the step groups are cool, too.) Thanks, David!

---

## [How to spec a render:update call](https://www.ruby-forum.com/t/how-to-spec-a-render-update-call/118274)

<div class="topic-metadata">

**Author:** [@korny](https://www.ruby-forum.com/u/korny)\
**Replies:** 0\
**Last updated:** [October 25, 2007, 9:26am UTC](https://www.ruby-forum.com/t/how-to-spec-a-render-update-call/118274 "2007-10-25T09:26:38Z")

</div>

Hi folks. I’m trying to work out how to verify that a controller has called a render:update block similar to: render :update do |page| page.replace\_html ‘edit’, :partial =\> ‘form’, :locals =\> { :operation =\> ‘edit’…

---

## [Specs for RJS](https://www.ruby-forum.com/t/specs-for-rjs/118263)

<div class="topic-metadata">

**Author:** [@nbits](https://www.ruby-forum.com/u/nbits)\
**Replies:** 0\
**Last updated:** [October 25, 2007, 8:12am UTC](https://www.ruby-forum.com/t/specs-for-rjs/118263 "2007-10-25T08:12:56Z")

</div>

What’s the current best practice for spec’ing (and stubbing) RJS? response.should have\_rjs(\*args, &block) from rspec\_on\_rails works well for things that assert\_select\_rjs supports. But for other things, like say pag…

---

## [Mocking within a Proc/Block?](https://www.ruby-forum.com/t/mocking-within-a-proc-block/118258)

<div class="topic-metadata">

**Author:** [@elight](https://www.ruby-forum.com/u/elight)\
**Replies:** 1\
**Last updated:** [October 25, 2007, 7:29am UTC](https://www.ruby-forum.com/t/mocking-within-a-proc-block/118258 "2007-10-25T07:29:42Z")

</div>

The following works: it “should evaluate a passed in block in the context of the interview object” do block = Proc.new { raise unless self.is\_a? (Interview) }.should\_not raise\_error Interview.create(:title =\> “Text”…

---

## [Working with the response DOM](https://www.ruby-forum.com/t/working-with-the-response-dom/118137)

<div class="topic-metadata">

**Author:** [@andywatts](https://www.ruby-forum.com/u/andywatts)\
**Replies:** 3\
**Last updated:** [October 25, 2007, 6:30am UTC](https://www.ruby-forum.com/t/working-with-the-response-dom/118137 "2007-10-25T06:30:42Z")

</div>

Hi, Anyone know a way to traverse/query the DOM in a response? I’m trying to write reusable story step implementations and as much as possible want to work with the actual response from a previous GET. As an example,…

---

## [Specs with -X fail](https://www.ruby-forum.com/t/specs-with-x-fail/118246)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 3\
**Last updated:** [October 25, 2007, 5:08am UTC](https://www.ruby-forum.com/t/specs-with-x-fail/118246 "2007-10-25T05:08:55Z")

</div>

I have some specs that run just fine using “rake spec:controllers” or “script/spec spec/controllers” but if I run “script/spec spec/controllers -X” with the spec server running, I end up getting some mocks that fail …

---

## [How do you specify a rubygem is being required?](https://www.ruby-forum.com/t/how-do-you-specify-a-rubygem-is-being-required/118235)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [October 25, 2007, 12:50am UTC](https://www.ruby-forum.com/t/how-do-you-specify-a-rubygem-is-being-required/118235 "2007-10-25T00:50:37Z")

</div>

Hi I’m loading a gem on demand but can’t find a way to spec it. Assuming rubygems is already loaded, I assumed the following would work: describe SqliteConnection, " class" do it “should require ‘sqlite3’” do Kernel…

---

## [Alternate File "require" line in TextMate bundle](https://www.ruby-forum.com/t/alternate-file-require-line-in-textmate-bundle/118228)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 1\
**Last updated:** [October 25, 2007, 12:05am UTC](https://www.ruby-forum.com/t/alternate-file-require-line-in-textmate-bundle/118228 "2007-10-25T00:05:35Z")

</div>

Ok, this is INCREDIBLY finicky of me, and I’m a really finicky person at the best of times, but I noticed that when you use the TM Alternate File command to create specs, it does it with a header line like this: File…

---

## [Changes to Story Runner steps](https://www.ruby-forum.com/t/changes-to-story-runner-steps/118142)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 3\
**Last updated:** [October 24, 2007, 10:22pm UTC](https://www.ruby-forum.com/t/changes-to-story-runner-steps/118142 "2007-10-24T22:22:00Z")

</div>

Hi all, The following only affects people who have bravely begun to experiment with the 2 day-old plain text story runner and definable groups of steps. For those who fit that bill, I just committed a few changes tha…

---

## [Plain text stories](https://www.ruby-forum.com/t/plain-text-stories/117879)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 17\
**Last updated:** [October 24, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/plain-text-stories/117879 "2007-10-24T20:58:19Z")

</div>

Thanks to discussions on this list, suggestions from many of you and a patch from Pat M., we now have Plain Text User Stories in Story Runner. Read more: http://blog.davidchelimsky.net/articles/2007/10/21/story-runne…

---

## [Stubbing Kernel.\` (backquote)](https://www.ruby-forum.com/t/stubbing-kernel-backquote/118191)

<div class="topic-metadata">

**Author:** [@katrash](https://www.ruby-forum.com/u/katrash)\
**Replies:** 1\
**Last updated:** [October 24, 2007, 7:43pm UTC](https://www.ruby-forum.com/t/stubbing-kernel-backquote/118191 "2007-10-24T19:43:57Z")

</div>

I’m trying to stub(!) the Kernel.\` (backquote) method and I’m having confusing (to me) results. Here’s the method I’m spec’ing: class Barcode … def raw\_barcodes self.make\_temporary\_copy OcrBarcode #{self.temp\_file\_…

---

## [An error on edge at -r 2767](https://www.ruby-forum.com/t/an-error-on-edge-at-r-2767/117937)

<div class="topic-metadata">

**Author:** [@sinclair\_bain](https://www.ruby-forum.com/u/sinclair_bain)\
**Replies:** 13\
**Last updated:** [October 24, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/an-error-on-edge-at-r-2767/117937 "2007-10-24T17:57:10Z")

</div>

Morning, Having done an svn up this morning all my specs are broken with the following: SQLite3::SQLException in ServiceConfig with minimum set of valid parameters should return nil for the service path’ SQL logic …

---

## [RSpec'd plugin in a non-RSpec rails app?](https://www.ruby-forum.com/t/rspecd-plugin-in-a-non-rspec-rails-app/118154)

<div class="topic-metadata">

**Author:** [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Replies:** 0\
**Last updated:** [October 24, 2007, 10:58am UTC](https://www.ruby-forum.com/t/rspecd-plugin-in-a-non-rspec-rails-app/118154 "2007-10-24T10:58:35Z")

</div>

I have a plugin that uses RSpec, and it’s being used by a Rails app that does not otherwise use RSpec (and does not want to). I can install the RSpec gem, but of course there is no RSpec-on-Rails gem. And I wouldn’t …

---

## [Testing layouts with RSpec on Rails](https://www.ruby-forum.com/t/testing-layouts-with-rspec-on-rails/116790)

<div class="topic-metadata">

**Author:** [@lodestone](https://www.ruby-forum.com/u/lodestone)\
**Replies:** 23\
**Last updated:** [October 24, 2007, 2:51am UTC](https://www.ruby-forum.com/t/testing-layouts-with-rspec-on-rails/116790 "2007-10-24T02:51:27Z")

</div>

Hey guys, Does anyone have any wisdom to share on the subject of speccing Rails layouts? Most of it’s plain old view specs stuff, but are there sensible ways to verify things like the yield call? (Mocking doesn’t cat…

---

## [Running rails specs outside of the normal project tree](https://www.ruby-forum.com/t/running-rails-specs-outside-of-the-normal-project-tree/118062)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 9\
**Last updated:** [October 23, 2007, 7:46pm UTC](https://www.ruby-forum.com/t/running-rails-specs-outside-of-the-normal-project-tree/118062 "2007-10-23T19:46:04Z")

</div>

I want to create a spec/regressions directory with various regressions (for my rails project). I tried the following: describe LoginController, “regression for user creation when steves\_sister does not exist”, :behav…

---

## [Problem Upgrading from 1.0.5 to 1.0.8](https://www.ruby-forum.com/t/problem-upgrading-from-1-0-5-to-1-0-8/118059)

<div class="topic-metadata">

**Author:** [@mly](https://www.ruby-forum.com/u/mly)\
**Replies:** 6\
**Last updated:** [October 23, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/problem-upgrading-from-1-0-5-to-1-0-8/118059 "2007-10-23T18:54:31Z")

</div>

Hey Guys, I’m getting the following error: NameError in ‘ProductsController with a GET to /products NO NAME (Because of Error raised in matcher)’ uninitialized constant Spec::Mocks::BaseExpectation::AnyArgsConstr…

---

## [Installing rspec/rspec\_on\_rails as system wide generator (or similar)](https://www.ruby-forum.com/t/installing-rspec-rspec-on-rails-as-system-wide-generator-or-similar/117944)

<div class="topic-metadata">

**Author:** [@welly](https://www.ruby-forum.com/u/welly)\
**Replies:** 1\
**Last updated:** [October 22, 2007, 7:44pm UTC](https://www.ruby-forum.com/t/installing-rspec-rspec-on-rails-as-system-wide-generator-or-similar/117944 "2007-10-22T19:44:26Z")

</div>

Hi all, What would be the best/easiest way of installing rspec as a system wide generator so I’m not having to download it or ./script/plugin install it every time? Thanks, Alastair Alastair M. Freelance web desi…

---

## [Re: plain text stories](https://www.ruby-forum.com/t/re-plain-text-stories/117933)

<div class="topic-metadata">

**Author:** [@PSSSSdraic\_Brady](https://www.ruby-forum.com/u/PSSSSdraic_Brady)\
**Replies:** 0\
**Last updated:** [October 22, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/re-plain-text-stories/117933 "2007-10-22T16:13:28Z")

</div>

Is there any adjective not covered so far ;). Great work, guys. PÃ¡draic Brady http://blog.astrumfutura.com OpenID Europe Foundation ----- Original Message ---- From: aslak hellesoy removed\_email\_address@domain.in…

---

## [Preferred mock framework](https://www.ruby-forum.com/t/preferred-mock-framework/117849)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 10\
**Last updated:** [October 22, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/preferred-mock-framework/117849 "2007-10-22T15:59:17Z")

</div>

Hi In light of the fact that RSpec mocks are going into maintenance mode in the near future, I was wondering what everyone was switching to. I liked the look of FlexMock most, so gave that a shot. However, there’s a…

---

## [Pending should\_receive shows as FIXED](https://www.ruby-forum.com/t/pending-should-receive-shows-as-fixed/117892)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 0\
**Last updated:** [October 22, 2007, 6:32am UTC](https://www.ruby-forum.com/t/pending-should-receive-shows-as-fixed/117892 "2007-10-22T06:32:07Z")

</div>

I have a mock should\_receive expectation wrapped in a “pending” block, and it appears as being fixed when the specs are run, when in reality it is not. Anyone else experience this behavior? I’m assuming this is becaus…

---

## [View spec response has no content?](https://www.ruby-forum.com/t/view-spec-response-has-no-content/117887)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 1\
**Last updated:** [October 22, 2007, 6:01am UTC](https://www.ruby-forum.com/t/view-spec-response-has-no-content/117887 "2007-10-22T06:01:10Z")

</div>

I have been messing with this all night, and can’t figure out what’s going wrong here. I have a test that renders the view, and then a shared behavior checks “response” for the various tags from a rails layout. The p…

---

## [Spec:models depends on development db:migration](https://www.ruby-forum.com/t/spec-models-depends-on-development-db-migration/117612)

<div class="topic-metadata">

**Author:** [@Keith\_McDonnell](https://www.ruby-forum.com/u/Keith_McDonnell)\
**Replies:** 6\
**Last updated:** [October 22, 2007, 12:13am UTC](https://www.ruby-forum.com/t/spec-models-depends-on-development-db-migration/117612 "2007-10-22T00:13:47Z")

</div>

For those interested … rake spec:models seems to clone the test database from development. If your dev db is empty, the models task fails mysteriously. Anyway, to make sure your dev db is at the current migration vers…

---

## [Quick facets hack](https://www.ruby-forum.com/t/quick-facets-hack/117860)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [October 21, 2007, 6:49pm UTC](https://www.ruby-forum.com/t/quick-facets-hack/117860 "2007-10-21T18:49:40Z")

</div>

Following the discussion earlier, I knocked together a trunk- compatible “facets” monkey-patch, if anyone wants to play with it: \<http://aviewfromafar.net/2007/10/21/quick-and-dirty-facets-in-rspec- trunk\> It’s simpl…

---

## [Interesting shared behaviour side-effect](https://www.ruby-forum.com/t/interesting-shared-behaviour-side-effect/117841)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 8\
**Last updated:** [October 21, 2007, 3:42pm UTC](https://www.ruby-forum.com/t/interesting-shared-behaviour-side-effect/117841 "2007-10-21T15:42:13Z")

</div>

Given the following ApplicationController specs: describe ApplicationController, “one facet”, :shared =\> true do it ‘foo’ … it ‘bar’ … end describe ApplicationController, “some other facet”, :shared =\> true do it …

---

## [Assumption tests](https://www.ruby-forum.com/t/assumption-tests/117705)

<div class="topic-metadata">

**Author:** [@datorrey](https://www.ruby-forum.com/u/datorrey)\
**Replies:** 27\
**Last updated:** [October 21, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/assumption-tests/117705 "2007-10-21T12:57:56Z")

</div>

Hi all, I’ve been thinking about the whole validator/relationship speccing issue, and I came up with a suggestion, which I’d love to get some feedback on. The full article is available at http://www.inter-sections.ne…

---

## [Using unit\_record and rspec (previously "Keeping unit tests from hitting the DB")](https://www.ruby-forum.com/t/using-unit-record-and-rspec-previously-keeping-unit-tests-from-hitting-the-db/117822)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 1\
**Last updated:** [October 20, 2007, 10:07pm UTC](https://www.ruby-forum.com/t/using-unit-record-and-rspec-previously-keeping-unit-tests-from-hitting-the-db/117822 "2007-10-20T22:07:33Z")

</div>

Back in August David C. wrote: “FYI - I tried using the unit\_record gem and there are some changes required in rspec to make it work, but they are trivial and it works great. The only trick is that the prevention of D…

---

## [TextMate bundle in MacroMates repo](https://www.ruby-forum.com/t/textmate-bundle-in-macromates-repo/117808)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 3\
**Last updated:** [October 20, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/textmate-bundle-in-macromates-repo/117808 "2007-10-20T18:42:06Z")

</div>

Hi Recently I sent a modified version of the GetBundle bundle to textmate-dev. It was failing because the RSpec bundle was from another repo (ie RubyForge). One of the replies said that the RSpec bundle was now in …

---

## [Stubbing a Kernel method?](https://www.ruby-forum.com/t/stubbing-a-kernel-method/117720)

<div class="topic-metadata">

**Author:** [@dangermoose](https://www.ruby-forum.com/u/dangermoose)\
**Replies:** 3\
**Last updated:** [October 20, 2007, 11:05am UTC](https://www.ruby-forum.com/t/stubbing-a-kernel-method/117720 "2007-10-20T11:05:14Z")

</div>

Is it possible to stub a Kernel method? I’m specifically interested in the ‘open’ method to test some code using open-uri. I’ve tried: Kernel.should\_receive(:open).with(‘filename’).and\_return(‘data’) However, this doe…

---

## [First cut at blockless given/when/then](https://www.ruby-forum.com/t/first-cut-at-blockless-given-when-then/117589)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 12\
**Last updated:** [October 20, 2007, 8:51am UTC](https://www.ruby-forum.com/t/first-cut-at-blockless-given-when-then/117589 "2007-10-20T08:51:51Z")

</div>

Hi all, I committed a first cut at blockless Givens/Whens/Thens to RSpec’s trunk: cd /path/to/rspec/project svn up cd rspec bin/spec examples/story/calculator.rb Take a look at examples/story/calculator.rb to see …

---

## [Patch idea for rspec\_on\_rails](https://www.ruby-forum.com/t/patch-idea-for-rspec-on-rails/117739)

<div class="topic-metadata">

**Author:** [@rsl](https://www.ruby-forum.com/u/rsl)\
**Replies:** 11\
**Last updated:** [October 19, 2007, 11:37pm UTC](https://www.ruby-forum.com/t/patch-idea-for-rspec-on-rails/117739 "2007-10-19T23:37:33Z")

</div>

I recently wrote a matcher for testing AR associations which allows you to specify things like: Foo.should have\_many(:bars).through(:bazes) I’m pretty darned proud of it and a couple of people have suggested that I s…

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

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