Top "Rspec2" questions

RSpec 2 is a version of the Behaviour-Driven Development tool for Ruby programmers.

rspec test result from csv.read mocking file

I'm using ruby 1.9 and I'm trying to do BDD. My first test 'should read in the csv' works, but the …

ruby-on-rails file mocking rspec rspec2
mock Rails.env.development? using rspec

I am writing a unit test using rspec. I would like to mock Rails.env.develepment? to return true. How …

rspec rspec2 rspec-rails
rspec `its` syntax with dynamic conditions

I've been really loving using contexts, subjects and its with rspec to really clean up my test code. Typical example: …

ruby scope rspec2
rspec-email - How to get the body text?

I'm using rspec with the email-spec gem. I'm trying to do: last_delivery = ActionMailer::Base.deliveries.last last_delivery.body.…

rspec rspec2 email-spec
Rspec Controller testing with Javascript

How do you test a controller in Rspec if the controller only responds with javascript? For example this would be …

ruby-on-rails-3.1 rspec2 rspec-rails
How to test a function which takes a block with rspec

I have a function, which accepts a block, opens a file, yields and returns: def start &block .....do some …

ruby rspec mocking rspec2 stubbing
FactoryGirl + RSpec + Rails 3 'undefined method <attribute>='

I'm fairly new to rails and TDD (as will no doubt be obvious from my post) and am having a …

ruby-on-rails-3 rspec2 factory-bot
rspec returns "PG::Error: ERROR: relation "table_name" does not exist"

Environment is REE(2011.12) on rvm, rspec 2.8.0, rails 3.0.6, and pg 0.13.2. Using PostgreSQL 8.3.17 on CentOS 5.6. The db:migrate have work correctly. But …

ruby-on-rails-3 postgresql rspec rspec2 rails-postgresql
how can I test accepts_nested_attributes_for with Rspec Rails3

I have a model as follows: class Greeting < ActiveRecord::Base attr_accessible :headline, :icon, :content belongs_to :user accepts_…

ruby-on-rails-3 testing rspec2
Resetting a singleton instance in Ruby

How do I reset a singleton object in Ruby? I know that one'd never want to do this in real …

ruby rspec singleton rspec2