# RSpec

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

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

---

## [How to use --pattern?](https://www.ruby-forum.com/t/how-to-use-pattern/176006)

<div class="topic-metadata">

**Author:** [@helix\_tp](https://www.ruby-forum.com/u/helix_tp)\
**Replies:** 5\
**Last updated:** [September 23, 2009, 9:42pm UTC](https://www.ruby-forum.com/t/how-to-use-pattern/176006 "2009-09-23T21:42:20Z")

</div>

(asked this yesterday on #rspec, no response…) Am I missing something obvious about --pattern? It seems to only run the first spec that matches the pattern; I expected it to run all that match. I tried: spec spec/m…

---

## [Cucumber senario](https://www.ruby-forum.com/t/cucumber-senario/175969)

<div class="topic-metadata">

**Author:** [@mithunperera](https://www.ruby-forum.com/u/mithunperera)\
**Replies:** 1\
**Last updated:** [September 23, 2009, 7:15am UTC](https://www.ruby-forum.com/t/cucumber-senario/175969 "2009-09-23T07:15:48Z")

</div>

Hi all, here is a scenario for create new Task Scenario: Create Valid Task Given I have no tasks And I am on the list of tasks When I follow “New Task” And I fill in “Description” with “Hello” And I press “Create” …

---

## [Rspec-rails and rack middleware](https://www.ruby-forum.com/t/rspec-rails-and-rack-middleware/175940)

<div class="topic-metadata">

**Author:** [@abg](https://www.ruby-forum.com/u/abg)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 2:29am UTC](https://www.ruby-forum.com/t/rspec-rails-and-rack-middleware/175940 "2009-09-23T02:29:25Z")

</div>

Ah ok. I tried that, but I can’t seem to figure out what to use for the def app … end method in my spec though. The app is my Rails app… for now I have something like: http://www.pastie.org/625791 I can get the dum…

---

## [Am I on the right track?](https://www.ruby-forum.com/t/am-i-on-the-right-track/175885)

<div class="topic-metadata">

**Author:** [@calvin](https://www.ruby-forum.com/u/calvin)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 1:19am UTC](https://www.ruby-forum.com/t/am-i-on-the-right-track/175885 "2009-09-23T01:19:06Z")

</div>

Hi, I am pretty new to RSpec and I wonder if some code I have written is leading me in the right direction. Any advice is greatly appreciated! here is the code from calculator.rb class Calculator def equation(val1, …

---

## [Can you guys please check this blog about rspec + webrat + no cucumber](https://www.ruby-forum.com/t/can-you-guys-please-check-this-blog-about-rspec-webrat-no-cucumber/175895)

<div class="topic-metadata">

**Author:** [@vamsi](https://www.ruby-forum.com/u/vamsi)\
**Replies:** 0\
**Last updated:** [September 22, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/can-you-guys-please-check-this-blog-about-rspec-webrat-no-cucumber/175895 "2009-09-22T13:29:30Z")

</div>

Hi all, We are new to rspec and webrat and we made some progress in using rspec + webrat with out cucumber, we posted a piece of code and hoping to get some comments from Rspec pros on our approach. Please let us kn…

---

## [Rspec-rails and rack middleware](https://www.ruby-forum.com/t/rspec-rails-and-rack-middleware/175886)

<div class="topic-metadata">

**Author:** [@abg](https://www.ruby-forum.com/u/abg)\
**Replies:** 1\
**Last updated:** [September 22, 2009, 6:59am UTC](https://www.ruby-forum.com/t/rspec-rails-and-rack-middleware/175886 "2009-09-22T06:59:41Z")

</div>

It doesn’t seem like my controller specs are calling my middleware on requests. Has anyone figured out a good way to test middlware with rspec? I’m thinking something like rails’ rails/actionpack/test/controller/sess…

---

## [Incompatible version?](https://www.ruby-forum.com/t/incompatible-version/175730)

<div class="topic-metadata">

**Author:** [@jorgegetafe](https://www.ruby-forum.com/u/jorgegetafe)\
**Replies:** 1\
**Last updated:** [September 21, 2009, 4:50pm UTC](https://www.ruby-forum.com/t/incompatible-version/175730 "2009-09-21T16:50:02Z")

</div>

I’m trying to use Rspe but I have this message error: undefined method evaluate\_value\_proc' for classSpec::Matchers::Change’ (NameError) I have this gems: rspec 1.2.8, 1.1.12 rspec-rails 2.3.7.2, 2.2.12 cuc…

---

## [\[ANN\] rspec and rspec-rails 1.2.9.rc1 Released](https://www.ruby-forum.com/t/ann-rspec-and-rspec-rails-1-2-9-rc1-released/175516)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [September 15, 2009, 2:47am UTC](https://www.ruby-forum.com/t/ann-rspec-and-rspec-rails-1-2-9-rc1-released/175516 "2009-09-15T02:47:28Z")

</div>

rspec and rspec-rails version 1.2.9.rc1 have been released! We’re using the new rubygems prerelease feature to do proper release candidates. This feature was introduced to rubygems a couple of versions back, but I’d …

---

## [After upgrade to newest TM Bundle I get "Invalid char" error](https://www.ruby-forum.com/t/after-upgrade-to-newest-tm-bundle-i-get-invalid-char-error/175496)

<div class="topic-metadata">

**Author:** [@steffen-hiller](https://www.ruby-forum.com/u/steffen-hiller)\
**Replies:** 0\
**Last updated:** [September 14, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/after-upgrade-to-newest-tm-bundle-i-get-invalid-char-error/175496 "2009-09-14T20:32:40Z")

</div>

Hey, I finally upgraded from a rather old RSpec Textmate Bundle to the newest version. (master:efe49e) But when running any commands such as “Run Examples” or “Alternate File” I get: /usr/bin/ruby:1: Invalid char \\3…

---

## [\[Cucumber\] testing emails with celerity - the best solution](https://www.ruby-forum.com/t/cucumber-testing-emails-with-celerity-the-best-solution/174206)

<div class="topic-metadata">

**Author:** [@slawosz](https://www.ruby-forum.com/u/slawosz)\
**Replies:** 0\
**Last updated:** [August 22, 2009, 2:09pm UTC](https://www.ruby-forum.com/t/cucumber-testing-emails-with-celerity-the-best-solution/174206 "2009-08-22T14:09:27Z")

</div>

Hi, I’m trying to test emails with Celerity. The problem is, because Celerity browser uses environment ‘cucumber’, but Cucubmer runs in ‘test’. Emails steps are running in ‘test’, so it is impossible to check mails s…

---

## [Workaround for spec\_server "can't dup NilClass"](https://www.ruby-forum.com/t/workaround-for-spec-server-cant-dup-nilclass/174095)

<div class="topic-metadata">

**Author:** [@davenolan](https://www.ruby-forum.com/u/davenolan)\
**Replies:** 0\
**Last updated:** [August 20, 2009, 7:11pm UTC](https://www.ruby-forum.com/t/workaround-for-spec-server-cant-dup-nilclass/174095 "2009-08-20T19:11:34Z")

</div>

On recent versions of RSpec/RSpec rails, if you are using Machinist/Factory\_Girl or similar, you may get “can’t dup NilClass” errors running specs through spec\_server. (Not on the initial run, but on all subsequent ru…

---

## [Match a regex with Cucumber + Webrat](https://www.ruby-forum.com/t/match-a-regex-with-cucumber-webrat/174090)

<div class="topic-metadata">

**Author:** [@nutsmuggler](https://www.ruby-forum.com/u/nutsmuggler)\
**Replies:** 0\
**Last updated:** [August 20, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/match-a-regex-with-cucumber-webrat/174090 "2009-08-20T18:37:33Z")

</div>

Hello folks, I am trying to learn Cucumber and testing in general. I am working on a app fo lingustic studies, but for the purpose of testing it can be compared to a “guess the song” app. When a new quiz is take, a p…

---

## [Concerned\_with, and maybe require\_dependency issues only when running specs?](https://www.ruby-forum.com/t/concerned-with-and-maybe-require-dependency-issues-only-when-running-specs/152436)

<div class="topic-metadata">

**Author:** [@cdb](https://www.ruby-forum.com/u/cdb)\
**Replies:** 1\
**Last updated:** [August 6, 2009, 1:48pm UTC](https://www.ruby-forum.com/t/concerned-with-and-maybe-require-dependency-issues-only-when-running-specs/152436 "2009-08-06T13:48:43Z")

</div>

Hi all, So in the interests of keeping a few areas of my code a bit under control, I’ve been investigating the concept of “concerned\_with” as described here: http://paulbarry.com/articles/2008/08/30/concerned-with-s…

---

## [Ruby 1.9 - autospec loadpath problem](https://www.ruby-forum.com/t/ruby-1-9-autospec-loadpath-problem/154509)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 5\
**Last updated:** [July 31, 2009, 7:03am UTC](https://www.ruby-forum.com/t/ruby-1-9-autospec-loadpath-problem/154509 "2009-07-31T07:03:38Z")

</div>

Mac OSX 10.5.5(Ruby 1.8.6 installed already) I installed Ruby 1.9.1 preview thusly: ============================================== port install readline cd ruby-1.9.1-preview1 ./configure --program-suffix=-trunk --w…

---

## [\[ANN\] rspec 1.2.8 Released](https://www.ruby-forum.com/t/ann-rspec-1-2-8-released/172229)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [July 17, 2009, 4:26am UTC](https://www.ruby-forum.com/t/ann-rspec-1-2-8-released/172229 "2009-07-17T04:26:28Z")

</div>

rspec version 1.2.8 has been released! http://rspec.info http://rubyforge.org/projects/rspec http://github.com/dchelimsky/rspec/wikis removed\_email\_address@domain.invalid removed\_email\_address@domain.invalid Behaviour…

---

## [Why should\_receive failure?](https://www.ruby-forum.com/t/why-should-receive-failure/172117)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 0\
**Last updated:** [July 15, 2009, 4:59am UTC](https://www.ruby-forum.com/t/why-should-receive-failure/172117 "2009-07-15T04:59:22Z")

</div>

class PeepCode def awesome “awesome” end end describe PeepCode do it “should fuck” do PeepCode.new.should\_receive(:awesome).and\_return(“awesome”) end end Spec::Mocks::MockExpectationError in ‘PeepCode should f…

---

## [Why should\_receive doesn't work, but stub does](https://www.ruby-forum.com/t/why-should-receive-doesnt-work-but-stub-does/172086)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 0\
**Last updated:** [July 14, 2009, 11:49am UTC](https://www.ruby-forum.com/t/why-should-receive-doesnt-work-but-stub-does/172086 "2009-07-14T11:49:16Z")

</div>

before(:each) do @myinstance = GetHtml.new end it “should be a Hyricot” do hy = open(‘test.html’) {|f| Hpricot f} @myinstance.should\_receive(:find\_html).with(“file:///test\_url”).and\_return(hy) end ++++++++++++++++…

---

## [ZenTest, RSpec and Ruby 1.9.1](https://www.ruby-forum.com/t/zentest-rspec-and-ruby-1-9-1/171948)

<div class="topic-metadata">

**Author:** [@rambor](https://www.ruby-forum.com/u/rambor)\
**Replies:** 0\
**Last updated:** [July 12, 2009, 4:01am UTC](https://www.ruby-forum.com/t/zentest-rspec-and-ruby-1-9-1/171948 "2009-07-12T04:01:50Z")

</div>

Hello, I thought maybe you guys could help. I’m trying to use RSpec along with ZenTest. However, all I seem to get back when trying to run tests is an exception. Is there a place I can find out what that exception i…

---

## [Selenium, Rspec in ruby. Start selenium server in code](https://www.ruby-forum.com/t/selenium-rspec-in-ruby-start-selenium-server-in-code/171384)

<div class="topic-metadata">

**Author:** [@kga85](https://www.ruby-forum.com/u/kga85)\
**Replies:** 0\
**Last updated:** [July 1, 2009, 2:43pm UTC](https://www.ruby-forum.com/t/selenium-rspec-in-ruby-start-selenium-server-in-code/171384 "2009-07-01T14:43:57Z")

</div>

I got it to work in ruby, but I have to start the selenium servver manualy before I runn the program. That is unesesary mutch work and complicated. Is there a way to start the selenium server inside the code and stop …

---

## [\[Rails\] Controller testing problem](https://www.ruby-forum.com/t/rails-controller-testing-problem/171375)

<div class="topic-metadata">

**Author:** [@ignacy](https://www.ruby-forum.com/u/ignacy)\
**Replies:** 1\
**Last updated:** [July 1, 2009, 1:48pm UTC](https://www.ruby-forum.com/t/rails-controller-testing-problem/171375 "2009-07-01T13:48:08Z")

</div>

Hi, I’m working on a legacy app - it was created in 1.2.5 then over time ported to 2.3. It has absolutely no tests - and I’m trying to fix that in between adding new functionality. My problem right now is that my App…

---

## [Integrate or isolate views?](https://www.ruby-forum.com/t/integrate-or-isolate-views/171207)

<div class="topic-metadata">

**Author:** [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Replies:** 7\
**Last updated:** [June 30, 2009, 7:15pm UTC](https://www.ruby-forum.com/t/integrate-or-isolate-views/171207 "2009-06-30T19:15:13Z")

</div>

Hello, I’ve been trying for two years to pick up BDD. I’m making progress, have just read through the chapters in The RSpec Book on spec’ing views and controllers. What is the difference between using integrate\_view…

---

## [Test doubles: expect "x" and don't care about anything else](https://www.ruby-forum.com/t/test-doubles-expect-x-and-dont-care-about-anything-else/171204)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 7\
**Last updated:** [June 29, 2009, 5:27pm UTC](https://www.ruby-forum.com/t/test-doubles-expect-x-and-dont-care-about-anything-else/171204 "2009-06-29T17:27:47Z")

</div>

I’ve had one of my recurring doubts about test doubles come up again. The full post is here but I’ll abbreviate the content in this message in any case: Thinking about switching to RR · wincent.com Basically, in one …

---

## [Testing a Create action to make sure the User is assigned to a new Model](https://www.ruby-forum.com/t/testing-a-create-action-to-make-sure-the-user-is-assigned-to-a-new-model/196976)

<div class="topic-metadata">

**Author:** [@magic6435](https://www.ruby-forum.com/u/magic6435)\
**Replies:** 1\
**Last updated:** [June 28, 2009, 11:13pm UTC](https://www.ruby-forum.com/t/testing-a-create-action-to-make-sure-the-user-is-assigned-to-a-new-model/196976 "2009-06-28T23:13:36Z")

</div>

I’m trying to figure out how to test that the current\_user does end up being attached to a new model that is being created which happens to be an Album. Here is the Controller code. def create @album = current\_user.…

---

## [Testing with activerecord at ThoughtWorks (Stubbing vs real DB)](https://www.ruby-forum.com/t/testing-with-activerecord-at-thoughtworks-stubbing-vs-real-db/171191)

<div class="topic-metadata">

**Author:** [@oreng](https://www.ruby-forum.com/u/oreng)\
**Replies:** 2\
**Last updated:** [June 28, 2009, 11:00pm UTC](https://www.ruby-forum.com/t/testing-with-activerecord-at-thoughtworks-stubbing-vs-real-db/171191 "2009-06-28T23:00:44Z")

</div>

I am reading the post by Fowler, ‘Ruby at ThoughtWorks’. http://martinfowler.com/articl/rubyAtThoughtWorks.html#WasRubyTheRightChoice He talks about testing with activerecord: "Right at the beginning of our use of Rub…

---

## [Testing a Create action to make sure the User is assigned to a new Model](https://www.ruby-forum.com/t/testing-a-create-action-to-make-sure-the-user-is-assigned-to-a-new-model/171213)

<div class="topic-metadata">

**Author:** [@magic6435](https://www.ruby-forum.com/u/magic6435)\
**Replies:** 0\
**Last updated:** [June 28, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/testing-a-create-action-to-make-sure-the-user-is-assigned-to-a-new-model/171213 "2009-06-28T20:09:09Z")

</div>

I’m trying to figure out how to test that the current\_user does end up being attached to a new model that is being created which happens to be an Album. Here is the Controller code. def create @album = current\_user.…

---

## [The problem with learning RSpec](https://www.ruby-forum.com/t/the-problem-with-learning-rspec/170062)

<div class="topic-metadata">

**Author:** [@seaton](https://www.ruby-forum.com/u/seaton)\
**Replies:** 8\
**Last updated:** [June 28, 2009, 12:29am UTC](https://www.ruby-forum.com/t/the-problem-with-learning-rspec/170062 "2009-06-28T00:29:45Z")

</div>

So… In the recent five-hundred-and-forty-seventh iteration of the “What’s the point of mocks?” discussion on this list, David C. ended a message with: \[ . . . \] Really, I think that’s what we should all be strivi…

---

## [RSpec not failing when requesting missing method/view](https://www.ruby-forum.com/t/rspec-not-failing-when-requesting-missing-method-view/171171)

<div class="topic-metadata">

**Author:** [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Replies:** 2\
**Last updated:** [June 27, 2009, 6:31pm UTC](https://www.ruby-forum.com/t/rspec-not-failing-when-requesting-missing-method-view/171171 "2009-06-27T18:31:24Z")

</div>

I’ve got this test: describe LoginController do describe “GET index” do it “should be successful” do get ‘index’ response.should be\_success end end end which passes, but a cucumber test fails on trying to get th…

---

## [What does :save =\> true mean in mock\_model?](https://www.ruby-forum.com/t/what-does-save-true-mean-in-mock-model/171172)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 4\
**Last updated:** [June 27, 2009, 6:17pm UTC](https://www.ruby-forum.com/t/what-does-save-true-mean-in-mock-model/171172 "2009-06-27T18:17:50Z")

</div>

@weather = mock\_model(Weather, :id =\> “1”) @forecast = mock\_model(Forecast, :weather =\> @weather, :save =\> true) what’s the different between with :save =\> true or without it?

---

## [Mock object in array is getting size called on it](https://www.ruby-forum.com/t/mock-object-in-array-is-getting-size-called-on-it/171105)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 11\
**Last updated:** [June 26, 2009, 6:31pm UTC](https://www.ruby-forum.com/t/mock-object-in-array-is-getting-size-called-on-it/171105 "2009-06-26T18:31:05Z")

</div>

Hi, I have this code: def self.bulk\_create\_from\_holly( params ) params.map do |param| new( param ) end end That is testeb by this expectation: it "should generate a new property with each set of params" do \[ @pa…

---

## [Expected output matches rendered output but still getting error in view spec](https://www.ruby-forum.com/t/expected-output-matches-rendered-output-but-still-getting-error-in-view-spec/170799)

<div class="topic-metadata">

**Author:** [@anthonybaker](https://www.ruby-forum.com/u/anthonybaker)\
**Replies:** 1\
**Last updated:** [June 26, 2009, 4:16pm UTC](https://www.ruby-forum.com/t/expected-output-matches-rendered-output-but-still-getting-error-in-view-spec/170799 "2009-06-26T16:16:09Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all, I’ve just gotten started using BDD with RSpec/Cucumber/Webrat and Rails and I’ve run into some frustration trying to get my view spec to pass. First of all, …

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

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