[ANN] RSpec-1.1.0 is released

The RSpec Development Team is pleased as glug (that’s kind of like
punch, but more festive) to announce RSpec-1.1.0.

Thanks to all who have contributed patches over the last few months.
Big thanks to Dan N. and Brian T. for their important work on
this release. Dan contributed his rbehave framework which is now the
Story Runner. Brian patiently did a TON of refactoring around
interoperability with Test::Unit, and the result is a much cleaner
RSpec core, and a clean adapter model that gets loaded when Test::Unit
is on the path.

== RSpec 1.1 brings four significant changes for RSpec users:

  • The RSpec Story Runner
  • Nested Example Groups
  • Support for Rails 2.0.1
  • Test::Unit interoperability

== Story Runner

The RSpec Story Runner is Dan N.'s rbehave framework merged into
RSpec. The Story Runner is a framework for expressing high level
requirements in the form of executable User Stories with Scenarios
that represent Customer Acceptance Tests.

RSpec 1.1 also ships with a Ruby on Rails extension called RailsStory,
which lets you write executable user stories for your rails apps as
well.

== Nested Example Groups

Now you can nest groups to organize things a bit better:

describe RubyDeveloper do

before(:each) do
@ruby_developer = RubyDeveloper.new
end

describe “using RSpec 1.1.0” do

before(:each) do
  @ruby_developer.use_rspec('1.1.0')
end

it "should be able to nest example groups" do
  @ruby_developer.should be_able_to_nest_example_groups
end

end

describe “using RSpec 1.0.1” do

before(:each) do
  @ruby_developer.use_rspec('1.0.8')
end

it "should not be able to nest example groups" do
  @ruby_developer.should_not be_able_to_nest_example_groups
end

end

end

Running this outputs:

RubyDeveloper using RSpec 1.1.0

  • should be able to nest example groups

RubyDeveloper using RSpec 1.0.8

  • should not be able to nest example groups

== Support for Rails 2.0.1

gem install rails
rails myapp
ruby script/install http://rspec.rubyforge.org/svn/tags/REL_1_1_0/rspec
ruby script/install
http://rspec.rubyforge.org/svn/tags/REL_1_1_0/rspec_on_rails
script/generate rspec

== Test::Unit Interoperability

Contrary to popular belief, Spec::Rails, RSpec’s Ruby on Rails plugin,
has been a Test::Unit wrapper since the the 0.7 release in November of
2006. RSpec 1.1 ups the ante though, offering a smooth transition from
Test::Unit to RSpec with or without Rails:

  1. Start with a TestCase:

require ‘test/unit’

class TransitionTest < Test::Unit::TestCase
def test_should_be_smooth
transition = Transition.new(
:from => “Test::Unit::TestCase”,
:to => “Spec::ExampleGroup”
)
assert_equal “really smooth”, transition.in_practice
end
end
2. Require ‘spec’

require ‘test/unit’
require ‘spec’

class TransitionTest < Test::Unit::TestCase
def test_should_be_smooth
transition = Transition.new(
:from => “Test::Unit::TestCase”,
:to => “Spec::ExampleGroup”
)
assert_equal “really smooth”, transition.in_practice
end
end
3. Convert TestCase to ExampleGroup

require ‘test/unit’
require ‘spec’

describe “transitioning from TestCase to ExampleGroup” do
def test_should_be_smooth
transition = Transition.new(
:from => “Test::Unit::TestCase”,
:to => “Spec::ExampleGroup”
)
assert_equal “really smooth”, transition.in_practice
end
end
4. Convert test methods to examples

require ‘test/unit’
require ‘spec’

describe “transitioning from TestCase to ExampleGroup” do
it “should be smooth” do
transition = Transition.new(
:from => “Test::Unit::TestCase”,
:to => “Spec::ExampleGroup”
)
assert_equal “really smooth”, transition.in_practice
end
end
5. Convert assertions to expectations

require ‘test/unit’
require ‘spec’

describe “transitioning from TestCase to ExampleGroup” do
it “should be smooth” do
transition = Transition.new(
:from => “Test::Unit::TestCase”,
:to => “Spec::ExampleGroup”)
transition.in_practice.should == “really smooth”
end
end
6. Un-require test/unit

require ‘spec’

describe “transitioning from TestCase to ExampleGroup” do
it “should be smooth” do
transition = Transition.new(
:from => “Test::Unit::TestCase”,
:to => “Spec::ExampleGroup”
)
transition.in_practice.should == “really smooth”
end
end
At every one of these steps after step 2, you can run the file with
the ruby command and you’ll be getting RSpec’s developer friendly
output. This means that you can transition things as gradually as you
like: no wholesale changes.

That’s the story. Thanks again to all who contributed and to all who
continue do so.

On Dec 13, 2007 9:58 PM, David C. [email protected] wrote:

is on the path.
The RSpec Story Runner is Dan N.'s rbehave framework merged into
Now you can nest groups to organize things a bit better:
@ruby_developer.use_rspec(‘1.1.0’)
before(:each) do

gem install rails
Test::Unit to RSpec with or without Rails:
)
transition = Transition.new(

end
:to => “Spec::ExampleGroup”)
:from => “Test::Unit::TestCase”,
That’s the story. Thanks again to all who contributed and to all who
continue do so.

Congratulations!! Very cool.

Pat

On 12/14/07, David C. [email protected] wrote:

The RSpec Development Team is pleased as glug (that’s kind of like
punch, but more festive) to announce RSpec-1.1.0.

Now I’m hoping that for those of us who have the two rspec plugins
installed as svn externals in a Rails 2.0.1 project the upgrade path
is just svn up.

Unfortunately when I try this right now I get:

$ svn up

Fetching external item into ‘vendor/plugins/rspec’
svn: Connection closed unexpectedly

I am pretty up to date (I think 10 revisions back, yesterday morning.)

$ svn info vendor/plugins/rspec
Path: vendor/plugins/rspec
URL: svn://rubyforge.org/var/svn/rspec/trunk/rspec
Repository Root: svn://rubyforge.org/var/svn/rspec
Repository UUID: 410327ef-2207-0410-a325-f78bbcb22a5a
Revision: 3146
Node Kind: directory
Schedule: normal
Last Changed Author: dchelimsky
Last Changed Rev: 3146
Last Changed Date: 2007-12-13 09:24:54 -0500 (Thu, 13 Dec 2007)

$ svn info vendor/plugins/rspec
rspec rspec_on_rails
shadowfax:~/ssanta rick$ svn info vendor/plugins/rspec_on_rails/
Path: vendor/plugins/rspec_on_rails
URL: svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails
Repository Root: svn://rubyforge.org/var/svn/rspec
Repository UUID: 410327ef-2207-0410-a325-f78bbcb22a5a
Revision: 3146
Node Kind: directory
Schedule: normal
Last Changed Author: dchelimsky
Last Changed Rev: 3146
Last Changed Date: 2007-12-13 09:24:54 -0500 (Thu, 13 Dec 2007)

Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Another question.

Will http://rspec.rubyforge.org/ be updated or is there already an
official source for updated docs?


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Dec 14, 2007 7:18 AM, Rick DeNatale [email protected] wrote:

Another question.

Will http://rspec.rubyforge.org/ be updated or is there already an
official source for updated docs?

We’ve had numerous permissions problems uploading the new docs over
the last couple of years. It’s been a while since it’s been a problem,
but something changed and I was once again unable to update the docs.

I’m working on it and will follow up when they are posted.

On Dec 14, 2007 7:15 AM, Rick DeNatale [email protected] wrote:

$ svn up

Fetching external item into ‘vendor/plugins/rspec’
svn: Connection closed unexpectedly

I am pretty up to date (I think 10 revisions back, yesterday morning.)

$ svn info vendor/plugins/rspec
Path: vendor/plugins/rspec
URL: svn://rubyforge.org/var/svn/rspec/trunk/rspec

I’d switch this to http:

Trunk:
http://rspec.rubyforge.org/svn/trunk/rspec
http://rspec.rubyforge.org/svn/trunk/rspec_on_rails

1.1.0:
http://rspec.rubyforge.org/svn/tags/REL_1_1_0/rspec
http://rspec.rubyforge.org/svn/tags/REL_1_1_0/rspec_on_rails

It’s a bit more reliable in my experience.

On 12/14/07, David C. [email protected] wrote:

I’m working on it and will follow up when they are posted.
Thanks,

Any insight on why on svn up the connection to
svn://rubyforge.org/var/svn/rspec is being dropped unexpectedely?


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On 12/14/07, David C. [email protected] wrote:

I’d switch this to http:

Trunk:
http://rspec.rubyforge.org/svn/trunk/rspec
http://rspec.rubyforge.org/svn/trunk/rspec_on_rails

Hmmmm

shadowfax:~/ssanta/vendor/plugins/rspec rick$ svn switch
http://rspec.rubyforge.org/svn/trunk/rspec
svn: Connection closed unexpectedly

k$ svn switch http://rspec.rubyforge.org/svn/trunk/rspec .
svn: ‘http://rspec.rubyforge.org/svn/trunk/rspec
is not the same repository as
‘svn://rubyforge.org/var/svn/rspec’


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Dec 14, 2007 7:29 AM, Rick DeNatale [email protected] wrote:

shadowfax:~/ssanta/vendor/plugins/rspec rick$ svn switch
http://rspec.rubyforge.org/svn/trunk/rspec
svn: Connection closed unexpectedly

k$ svn switch http://rspec.rubyforge.org/svn/trunk/rspec .
svn: ‘http://rspec.rubyforge.org/svn/trunk/rspec
is not the same repository as
‘svn://rubyforge.org/var/svn/rspec’

Rick - you’re going to need to take this to rubyforge. There’s not
much we can do about it.

On 12/14/07, Scott T. [email protected] wrote:

On Dec 14, 2007, at 8:29 AM, Rick DeNatale wrote:

Yeah, I used to have this problem all the time. At one point I even
set up an SVK mirror for the rspec repository because of this problem.

The admins at rubyforge advise using the http repos - and so far, it
has caused me no problems.

Well all I need to do is figure out how to get the switch to work.

In the meantime, I opened a ticket on the Rubyforge support project.


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Thu, 13 Dec 2007, Pat M. wrote:

Congratulations!! Very cool.

Wow, did you really need to quote the ENTIRE email just to put in a ONE
word reply?

On Dec 14, 2007 8:20 AM, Eno [email protected] wrote:

On Thu, 13 Dec 2007, Pat M. wrote:

Congratulations!! Very cool.

Wow, did you really need to quote the ENTIRE email just to put in a ONE
word reply?

I think you mean three words, plus two exclamation marks :slight_smile:

Pat

On Fri, 14 Dec 2007, Pat M. wrote:

I think you mean three words, plus two exclamation marks :slight_smile:
Funny.

On Dec 14, 2007, at 8:29 AM, Rick DeNatale wrote:

shadowfax:~/ssanta/vendor/plugins/rspec rick$ svn switch
http://rspec.rubyforge.org/svn/trunk/rspec
svn: Connection closed unexpectedly

k$ svn switch http://rspec.rubyforge.org/svn/trunk/rspec .
svn: ‘http://rspec.rubyforge.org/svn/trunk/rspec
is not the same repository as
‘svn://rubyforge.org/var/svn/rspec’

Yeah, I used to have this problem all the time. At one point I even
set up an SVK mirror for the rspec repository because of this problem.

The admins at rubyforge advise using the http repos - and so far, it
has caused me no problems.

Scott

Does anyone knows how to use stories with Rails? Maybe a rake task, or
even
a command. I would like to try it out, never used something like user
stories. Appears to be interesting.

Thanks,
Dante

On Jan 3, 2008 12:46 PM, Dante R. [email protected]valid wrote:

Does anyone knows how to use stories with Rails? Maybe a rake task, or even
a command. I would like to try it out, never used something like user
stories. Appears to be interesting.

Just use :type => RailsStory in with_steps_for:

with_steps_for :foo do
run ‘path/to/story/file’, :type => RailsStory
end

Cheers,
David

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs