[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] RSpec-1.1.0 is released

David Chelimsky

12/14/2007 5:58:00 AM

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 North and Brian Takita 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 North'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...
ruby script/install http://rspec.rubyforge.org/svn/tags/REL_1..._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.

3 Answers

Pat Maddox

12/14/2007 7:02:00 AM

0

On Dec 13, 2007 9:58 PM, David Chelimsky <dchelimsky@gmail.com> wrote:
>
> 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 North and Brian Takita 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 North'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...
> ruby script/install http://rspec.rubyforge.org/svn/tags/REL_1..._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.
>
>

Congratulations!! Very cool.

Pat

Dante Regis

1/3/2008 2:47:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

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 Dec 14, 2007 4:01 AM, Pat Maddox <pergesu@gmail.com> wrote:

> On Dec 13, 2007 9:58 PM, David Chelimsky <dchelimsky@gmail.com> wrote:
> >
> > 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 North and Brian Takita 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 North'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...
> > ruby script/install
> http://rspec.rubyforge.org/svn/tags/REL_1..._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.
> >
> >
>
> Congratulations!! Very cool.
>
> Pat
>
>

David Chelimsky

1/3/2008 6:18:00 PM

0

On Jan 3, 2008 12:46 PM, Dante Regis <dante.regis@gmail.com> 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

>
> Thanks,
> Dante
>
>
> On Dec 14, 2007 4:01 AM, Pat Maddox <pergesu@gmail.com> wrote:
>
> > On Dec 13, 2007 9:58 PM, David Chelimsky <dchelimsky@gmail.com> wrote:
> > >
> > > 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 North and Brian Takita 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 North'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...
> > > ruby script/install
> > http://rspec.rubyforge.org/svn/tags/REL_1..._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.
> > >
> > >
> >
> > Congratulations!! Very cool.
> >
> > Pat
> >
> >
>