# RSpec

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

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

---

## [RSpec sundry questions](https://www.ruby-forum.com/t/rspec-sundry-questions/147537)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 2\
**Last updated:** [September 10, 2008, 8:12am UTC](https://www.ruby-forum.com/t/rspec-sundry-questions/147537 "2008-09-10T08:12:08Z")

</div>

Hi, Q1 - Can I assume that the core testing framework (e.g. rails unit testing versus RSpec) is a kind of separate issue to whether you using mocking or not? i.e. you could use Mocha with either the rails unit test f…

---

## [Cucumber and fixtures/FixtureReplacement](https://www.ruby-forum.com/t/cucumber-and-fixtures-fixturereplacement/148140)

<div class="topic-metadata">

**Author:** [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Replies:** 8\
**Last updated:** [September 10, 2008, 3:03am UTC](https://www.ruby-forum.com/t/cucumber-and-fixtures-fixturereplacement/148140 "2008-09-10T03:03:44Z")

</div>

Hey guys, I’d never used RSpec Stories before, so I decided to follow the apparent direction of the wind and just jump right into cucumber. I’m dabbling with/using Cucumber and really like it. Good job, aslak! Where …

---

## [What does a skilled BDD-/RSpec-er want in a job?](https://www.ruby-forum.com/t/what-does-a-skilled-bdd-rspec-er-want-in-a-job/147974)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 10\
**Last updated:** [September 9, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/what-does-a-skilled-bdd-rspec-er-want-in-a-job/147974 "2008-09-09T20:52:20Z")

</div>

Hi everyone, Hope this is not too OT, but I know I will get a good answer here… I will be soon\* helping one of my clients write a job spec for an agile software developer, to work on a Ruby web app using RSpec. I’d …

---

## [Backslash in story runner scenario](https://www.ruby-forum.com/t/backslash-in-story-runner-scenario/148136)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 1\
**Last updated:** [September 9, 2008, 7:01pm UTC](https://www.ruby-forum.com/t/backslash-in-story-runner-scenario/148136 "2008-09-09T19:01:12Z")

</div>

Hi, If a backslash is put into a story runner scenario Scenario: Message is sent Given an order has been created When I goto the purchased screen And something with a \\ breaks it then this exception is created c:/…

---

## [Scenarios on production data](https://www.ruby-forum.com/t/scenarios-on-production-data/147734)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 15\
**Last updated:** [September 9, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/scenarios-on-production-data/147734 "2008-09-09T16:21:49Z")

</div>

I’m just thinking out loud here… It could be useful to have a way to run scenarios on a copy of a fully populated production database, as an alternative to normal use. Not sure how that’d work, maybe replace the Given…

---

## [How to unit test code that connects to the external resources?](https://www.ruby-forum.com/t/how-to-unit-test-code-that-connects-to-the-external-resources/148057)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 1:20am UTC](https://www.ruby-forum.com/t/how-to-unit-test-code-that-connects-to-the-external-resources/148057 "2008-09-09T01:20:52Z")

</div>

By external resources, I mean, the code start a http connection and GET xmls from the url specified. I will definitely not rely my unit test on an external url or anything like that. But how do I unit test the method?…

---

## [\`exit?': undefined method \`run?' for Test::Unit:Module (NoMethodError)?](https://www.ruby-forum.com/t/exit-undefined-method-run-for-test-module-nomethoderror/139709)

<div class="topic-metadata">

**Author:** [@kasutaja](https://www.ruby-forum.com/u/kasutaja)\
**Replies:** 2\
**Last updated:** [September 8, 2008, 8:41am UTC](https://www.ruby-forum.com/t/exit-undefined-method-run-for-test-module-nomethoderror/139709 "2008-09-08T08:41:02Z")

</div>

Why am I getting this error if running from Netbeans or just from command line with executing blah\_spec.rb? If I run with spec bla blah blah\_spec.rb then it’s fine. . Finished in 0.264 seconds 1 example, 0 failure…

---

## [2nd attempt at mocking and stubbing](https://www.ruby-forum.com/t/2nd-attempt-at-mocking-and-stubbing/147845)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 10\
**Last updated:** [September 7, 2008, 10:26pm UTC](https://www.ruby-forum.com/t/2nd-attempt-at-mocking-and-stubbing/147845 "2008-09-07T22:26:51Z")

</div>

So, after reading all of those fantastic emails discussing testing behaviour vs state, I decided to try mocking and stubbing a couple of methods. I think I did well on my first one, but I’m not sure what the best way …

---

## [Failing in TextMate but not in rake](https://www.ruby-forum.com/t/failing-in-textmate-but-not-in-rake/147746)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 7\
**Last updated:** [September 6, 2008, 11:47pm UTC](https://www.ruby-forum.com/t/failing-in-textmate-but-not-in-rake/147746 "2008-09-06T23:47:15Z")

</div>

When I run a spec file from TextMate using the RSpec bundle’s “Run Examples” command (either using command-R or the bundle menu item with the spec file open), I get an error dialog with the following text: “Missing th…

---

## [Issue with application controller spec](https://www.ruby-forum.com/t/issue-with-application-controller-spec/147861)

<div class="topic-metadata">

**Author:** [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Replies:** 7\
**Last updated:** [September 6, 2008, 5:02pm UTC](https://www.ruby-forum.com/t/issue-with-application-controller-spec/147861 "2008-09-06T17:02:01Z")

</div>

I’m having some trouble trying to spec some methods in my Rails application controller. I’m new to rspec converting over from straight test::unit. Here is the method in my application.rb controller that I’m trying to …

---

## [Writing specs for a module](https://www.ruby-forum.com/t/writing-specs-for-a-module/147631)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 2\
**Last updated:** [September 6, 2008, 9:20am UTC](https://www.ruby-forum.com/t/writing-specs-for-a-module/147631 "2008-09-06T09:20:45Z")

</div>

I’m writing specs for a module for my Rails app. The module will live in lib/ . For now, I’ve created the directory spec/lib/ to store the specs for files in lib/ . However, I’m curious to know if there’s a currently …

---

## [Do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries](https://www.ruby-forum.com/t/do-i-use-mocking-vs-fixtures-for-methods-that-produce-results-based-on-non-trivial-sql-queries/147806)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 13\
**Last updated:** [September 6, 2008, 9:01am UTC](https://www.ruby-forum.com/t/do-i-use-mocking-vs-fixtures-for-methods-that-produce-results-based-on-non-trivial-sql-queries/147806 "2008-09-06T09:01:27Z")

</div>

Hi, In cases where I have model methods that are generating data based on non-trivial SQL queries to a database (e.g. to pull together data required to plot an appropriate graph), does this really require a tradition…

---

## [Four Question From an RSpec Baby - Give me something to chew](https://www.ruby-forum.com/t/four-question-from-an-rspec-baby-give-me-something-to-chew/147031)

<div class="topic-metadata">

**Author:** [@ldenman](https://www.ruby-forum.com/u/ldenman)\
**Replies:** 17\
**Last updated:** [September 5, 2008, 9:28pm UTC](https://www.ruby-forum.com/t/four-question-from-an-rspec-baby-give-me-something-to-chew/147031 "2008-09-05T21:28:19Z")

</div>

The project has been written - around 10,000 lines of code, but certainly less than that to add tests to. There has been no official testing put into place, and I’d very much like to implement RSpec into the project f…

---

## [Make classes in a module available to examples](https://www.ruby-forum.com/t/make-classes-in-a-module-available-to-examples/147795)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [September 5, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/make-classes-in-a-module-available-to-examples/147795 "2008-09-05T17:49:22Z")

</div>

Hi Sorry if this is documented somewhere, I can’t find it on rspec.info or Google. Say I have this code (simple example based no the RSpec site): module Bank class Account def balance 0 end end end describe “A…

---

## [Is there a way to create spec tests (including directories) for an existing set of models/controller](https://www.ruby-forum.com/t/is-there-a-way-to-create-spec-tests-including-directories-for-an-existing-set-of-models-controller/147766)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 3\
**Last updated:** [September 5, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-create-spec-tests-including-directories-for-an-existing-set-of-models-controller/147766 "2008-09-05T15:56:14Z")

</div>

Hi, is there a way to create spec tests (including directories) for an existing set of models/controllers? (i.e. as opposed to the generate options that rspec provides when you are creating models/controllers etc t…

---

## [Documentation for Plain-Text Stories](https://www.ruby-forum.com/t/documentation-for-plain-text-stories/145666)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 60\
**Last updated:** [September 4, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/documentation-for-plain-text-stories/145666 "2008-09-04T15:41:19Z")

</div>

Can I help the project by writing some docs about the plain-text story runner for the rspec.info website? It would surely help me to get it wired in my own mind if I have to write it up for the world. Would this be he…

---

## [Webrat question, form without buttons](https://www.ruby-forum.com/t/webrat-question-form-without-buttons/147623)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 9\
**Last updated:** [September 4, 2008, 1:13am UTC](https://www.ruby-forum.com/t/webrat-question-form-without-buttons/147623 "2008-09-04T01:13:55Z")

</div>

Can you submit a form that has no submit button/image? – Zach D. http://www.continuousthinking.com

---

## [Setting instance variables for controllers](https://www.ruby-forum.com/t/setting-instance-variables-for-controllers/147607)

<div class="topic-metadata">

**Author:** [@patrick\_r](https://www.ruby-forum.com/u/patrick_r)\
**Replies:** 4\
**Last updated:** [September 3, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/setting-instance-variables-for-controllers/147607 "2008-09-03T21:14:19Z")

</div>

Hi everyone, I have been trying to find an answer to this question and have not been able to. Any help is greatly appreciated. I am using Rails 2.1.0 and Rspec 1.1.4. How can I set an instance variable in my Rspec t…

---

## [Speccing the existance of an unchecked checkbox](https://www.ruby-forum.com/t/speccing-the-existance-of-an-unchecked-checkbox/147588)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 4\
**Last updated:** [September 3, 2008, 3:43pm UTC](https://www.ruby-forum.com/t/speccing-the-existance-of-an-unchecked-checkbox/147588 "2008-09-03T15:43:56Z")

</div>

Hey list, I found myself trying to verify there are some non-checked checkboxes in a template today, and am kinda stumped how to do it :). A checked checkbox is easy, have\_tag('input\[type=checkbox\] \[checked=checked\])…

---

## [Fixture instantiated in before block?](https://www.ruby-forum.com/t/fixture-instantiated-in-before-block/147583)

<div class="topic-metadata">

**Author:** [@Keith\_McDonnell](https://www.ruby-forum.com/u/Keith_McDonnell)\
**Replies:** 1\
**Last updated:** [September 3, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/fixture-instantiated-in-before-block/147583 "2008-09-03T14:59:53Z")

</div>

Hi all, Are fixtures not loaded & instantiated in the before block? I thought they /should/ be :slight\_smile: eg before(:all) do \[@matt\_applying\_for\_it, @matt, @it\_industry\].each { |v| puts v.inspect } end it “sho…

---

## [Controller specs erroneously loading views in edge rails?](https://www.ruby-forum.com/t/controller-specs-erroneously-loading-views-in-edge-rails/146613)

<div class="topic-metadata">

**Author:** [@jjrussell](https://www.ruby-forum.com/u/jjrussell)\
**Replies:** 7\
**Last updated:** [September 3, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/controller-specs-erroneously-loading-views-in-edge-rails/146613 "2008-09-03T13:00:47Z")

</div>

Hello, I think I may have found a bug between rspec and edge rails… But I’m new to this so I’m hoping someone else can confirm before I go filing bug reports. Basically, I’m seeing what “appears” to be my controller …

---

## [GiT and RSpec](https://www.ruby-forum.com/t/git-and-rspec/139294)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [September 3, 2008, 1:52am UTC](https://www.ruby-forum.com/t/git-and-rspec/139294 "2008-09-03T01:52:45Z")

</div>

script/plugin install doesn’t support getting a specific version from git yet. To do that you have to use ‘git clone’ and then ‘git checkout 1.1.4’ (in this case). As an alternative to script/plugin or git-clone, yo…

---

## [Cucumber: Before(:all)](https://www.ruby-forum.com/t/cucumber-before-all/147501)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 6\
**Last updated:** [September 2, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/cucumber-before-all/147501 "2008-09-02T19:53:40Z")

</div>

Is there a way right now to run some setup code once after environment.rb has loaded but before all the scenarios are run? And how about a teardown after everything’s done? cheers, Matt http://blog.mattwynne.net I…

---

## [Specs pass when run with other app specs, but fail when run independently](https://www.ruby-forum.com/t/specs-pass-when-run-with-other-app-specs-but-fail-when-run-independently/147453)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 5\
**Last updated:** [September 2, 2008, 6:41am UTC](https://www.ruby-forum.com/t/specs-pass-when-run-with-other-app-specs-but-fail-when-run-independently/147453 "2008-09-02T06:41:13Z")

</div>

Hi there, I’ve noticed something a little odd with the session\_controller specs that are generated from the rails plugin restful\_authentication. When they’re run with all the other app specs (i.e. when I first fire…

---

## [Opening a response in browser (webrat)](https://www.ruby-forum.com/t/opening-a-response-in-browser-webrat/147431)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 3\
**Last updated:** [September 2, 2008, 3:20am UTC](https://www.ruby-forum.com/t/opening-a-response-in-browser-webrat/147431 "2008-09-02T03:20:41Z")

</div>

Given I am running an rspec story And it uses webrat And I am using rdebug When I am at a breakpoint (eg after a ‘visits’ in a step) Then how can I open the current response in a browser to see what the page actuall…

---

## [Cucumber: GivenScenario doesn't seem to work](https://www.ruby-forum.com/t/cucumber-givenscenario-doesnt-seem-to-work/147430)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 2\
**Last updated:** [September 2, 2008, 12:35am UTC](https://www.ruby-forum.com/t/cucumber-givenscenario-doesnt-seem-to-work/147430 "2008-09-02T00:35:10Z")

</div>

I’m hardly a story-runner expert, so I may be making a dumb mistake here… I’m trying to get one scenario to run another as part of its Given clause. It looks like this: Scenario: Admin user merges two venues GivenSce…

---

## [Application-wide spec\_helper method](https://www.ruby-forum.com/t/application-wide-spec-helper-method/147036)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 10\
**Last updated:** [September 1, 2008, 7:34pm UTC](https://www.ruby-forum.com/t/application-wide-spec-helper-method/147036 "2008-09-01T19:34:37Z")

</div>

If a helper method can be used for multiple model specs, obviously it should not be placed within a specific model’s spec helper file. Is there a recommended file in which to put such a method? Maybe spec/ helpers/app…

---

## [Spec'ing the existence of #require](https://www.ruby-forum.com/t/specing-the-existence-of-require/147339)

<div class="topic-metadata">

**Author:** [@cremes](https://www.ruby-forum.com/u/cremes)\
**Replies:** 5\
**Last updated:** [August 31, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/specing-the-existence-of-require/147339 "2008-08-31T22:00:23Z")

</div>

I looked through the mailing list archive but unfortunately my search terms are too generic (spec and require…). I am writing ruby code that runs under jruby in an embedded environment. Periodically I will install new…

---

## [How to spec the existence of specs](https://www.ruby-forum.com/t/how-to-spec-the-existence-of-specs/147187)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 4\
**Last updated:** [August 31, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/how-to-spec-the-existence-of-specs/147187 "2008-08-31T21:40:23Z")

</div>

I’m writing a Rails plugin that generates specs for Rails models. Obviously, I want to use RSpec to spec this plugin. The plugin, called ModelSpeccer, contains a module with three methods. Each method generates specs …

---

## [I want RSpec for CSS layout](https://www.ruby-forum.com/t/i-want-rspec-for-css-layout/146333)

<div class="topic-metadata">

**Author:** [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Replies:** 9\
**Last updated:** [August 31, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/i-want-rspec-for-css-layout/146333 "2008-08-31T19:32:14Z")

</div>

I don’t even know how it’d be possible (through Selenium?), but I want it. I want to see if my stupid CSS hacks break. I want to say: describe “#nav-column” do body = something("#body-column") it “should line up at…

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

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