Scenarios Plugin Pre-Announcement

This is sort of a pre-announcement for a Rails plugin my friend Adam
Williams and I are working on. We’re in the process of extracting it
from a project we are working on so that it can be generally useful to
the Rails community. We are calling it “Scenarios”. It is a drop in
replacement for Rails fixtures:

http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README

If you are interested in playing around with it be sure to read through:

http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/spec/scenarios_spec.rb

And check out the example scenarios in:

http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/spec/scenarios/

You will need to be running off of rspec/trunk and probably rails edge
as well.

More documentation and examples will follow with the official release.


John L.
http://wiseheartdesign.com

On 10/16/07, John W. Long [email protected] wrote:

http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/spec/scenarios_spec.rb
John L.
http://wiseheartdesign.com


rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

I would recommend that you rename it, because “Scenario” already has a
precise meaning and plays a very important role in RSpec.

Pat

Looks good.

I recently spent a lot of time looking at something similar before going
with the fixtures replacement plugin.
It gives me new_user, create_user, create_user(:first_name =>
‘overriddefault’ ).
Also creates records for associations where required. This is useful in
story runner, where I’m mocking less.
screencast here
http://railsnewbie.com/files/fixture_replacement_demo_new.mov

  • Andy

John W. Long-2 wrote:


John L.
http://wiseheartdesign.com


rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users


View this message in context:
http://www.nabble.com/Scenarios-Plugin-Pre-Announcement-tf4637152.html#a13245324
Sent from the rspec-users mailing list archive at Nabble.com.

On 10/16/07, Andy W. [email protected] wrote:

I recently spent a lot of time looking at something similar before going
with the fixtures replacement plugin.
It gives me new_user, create_user, create_user(:first_name =>
‘overriddefault’ ).
Also creates records for associations where required. This is useful in
story runner, where I’m mocking less.
screencast here
http://railsnewbie.com/files/fixture_replacement_demo_new.mov

I like the auto generation of those methods. That’s something that we
have thought about and intend to add to Scenarios at some point in the
future. The huge advantage of Scenarios over the FixtureReplacement
plugin (if I understand it correctly) is that it gives you a way to
group and manage your record creation calls. So you can say you want
to use the Accounts scenario and it will load up your basic accounts,
transactions, etc…


John L.
http://wiseheartdesign.com

On 10/16/07, Pat M. [email protected] wrote:

I would recommend that you rename it, because “Scenario” already has a
precise meaning and plays a very important role in RSpec.

I can certainly understand why you would say that. The name is
inspired by another project mentioned on ErrTheBlog:

http://errtheblog.com/post/7708

I’m open to other suggestions.


John L.
http://wiseheartdesign.com

On Oct 17, 2007, at 1:38 AM, John W. Long wrote:

http://railsnewbie.com/files/fixture_replacement_demo_new.mov

I like the auto generation of those methods. That’s something that we
have thought about and intend to add to Scenarios at some point in the
future. The huge advantage of Scenarios over the FixtureReplacement
plugin (if I understand it correctly) is that it gives you a way to
group and manage your record creation calls. So you can say you want
to use the Accounts scenario and it will load up your basic accounts,
transactions, etc…

I haven’t had the chance to really play with your plugin. How is it
different than fixture scenarios (from err.the.blog)?

Scott

how about “factory”?
or something along that metaphor
“assemblies”
… “erections”? maybe not…
:slight_smile:

I just updated the README. It gives a better overview of the Scenarios
plugin now:

http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README


John L.
http://wiseheartdesign.com

On 10/17/07, John L. [email protected] wrote:

I just updated the README. It gives a better overview of the Scenarios
plugin now:

http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README

Has anyone got this to work with Edge Rails/Rspec? I’m getting the
following stack trace when I try and execute my specs after installing
the plugin:

/Users/jknowles/Development/projects/limespot/trunk/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:263:in
load_missing_constant': uninitialized constant Spec::DSL::ExampleModule (NameError) from /Users/jknowles/Development/projects/limespot/trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing’
from
/Users/jknowles/Development/projects/limespot/trunk/vendor/plugins/scenarios/lib/scenarios/dsl/extensions.rb:12
from
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from
/Users/jknowles/Development/projects/limespot/trunk/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' from /Users/jknowles/Development/projects/limespot/trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
from
/Users/jknowles/Development/projects/limespot/trunk/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' from /Users/jknowles/Development/projects/limespot/trunk/vendor/plugins/scenarios/init.rb:4:inevaluate’
… 22 levels…
from
/Users/jknowles/Development/projects/limespot/trunk/vendor/plugins/rspec/lib/spec/runner/options.rb:188:in
each' from /Users/jknowles/Development/projects/limespot/trunk/vendor/plugins/rspec/lib/spec/runner/options.rb:188:inload_paths’
from
/Users/jknowles/Development/projects/limespot/trunk/vendor/plugins/rspec/lib/spec/runner/command_line.rb:21:in
`run’
from
/Users/jknowles/Development/projects/limespot/trunk/vendor/plugins/rspec/bin/spec:3

On 10/26/07, Josh K. [email protected] wrote:

Has anyone got this to work with Edge Rails/Rspec? I’m getting the
following stack trace when I try and execute my specs after installing
the plugin:

FYI I got this to work by removing the reference to ExampleModule
(lines 12 - 14 of extensions.rb).

Great plugin, definitely the best way to manage fixtures that I’ve tried
so far.

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