Hi Brian,
thank you for rspec on merb. hoping to follow your example, the
starting point is simply merb and
mrblog at Revision 233 with the single change to spec_helper.rb for
my local mrblog_test database
the only spec is the checked out user_spec.rb
Did you get any exceptions related to loading the fixtures?
Are you using the fixtures method in the Behaviour block?
there are no exceptions related to loading the fixtures the tables
are not created (see below)
user_spec.rb does use the fixture method in the Behavior block.
output from a spec -b on this spec file is shown below with edits to
reduce the length of this post.
let me know if i've missed something in my setup or if i can provide
more information.
regards,
greg
$ pwd
~/Sites/mrblog/trunk
$ spec -v
RSpec-0.9.3 (r1916) - BDD for Ruby
$ spec -b test/spec/models/user_spec.rb
merb init called
ActiveRecord session mixed in
Rails session compatibilty on.
FFFFFFFF
1)
ActiveRecord::StatementInvalid in 'User being authenticated should
create user'
Mysql::Error: Table 'mrblog_test.users' doesn't exist: SHOW FIELDS
FROM users
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/abstract_adapter.rb:128:in `log'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/mysql_adapter.rb:243:in `execute'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/mysql_adapter.rb:348:in `columns'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/base.rb:763:in `columns'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/calculations.rb:257:in `column_for'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/calculations.rb:116:in `calculate'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/calculations.rb:45:in `count'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/matchers/
change.rb:28:in `send'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/matchers/
change.rb:28:in `execute_change'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/matchers/
change.rb:20:in `matches?'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/expectations/
handler.rb:14:in `handle_matcher'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/expectations/
extensions/object.rb:32:in `should'
./test/spec/models/user_spec.rb:8:
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
73:in `instance_eval'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
73:in `run_example'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
23:in `run'
/opt/local/lib/ruby/1.8/timeout.rb:48:in `timeout'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
21:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/
behaviour.rb:70:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/
behaviour.rb:67:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/
behaviour.rb:67:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:45:in `run_behaviours'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:44:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:44:in `run_behaviours'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:27:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
command_line.rb:17:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/bin/spec:3:
/opt/local/bin/spec:16:in `load'
/opt/local/bin/spec:16:
2)
ActiveRecord::StatementInvalid in 'User being authenticated should
require login'
Mysql::Error: Table 'mrblog_test.users' doesn't exist: SHOW FIELDS
FROM users
3)
ActiveRecord::StatementInvalid in 'User being authenticated should
require password'
Mysql::Error: Table 'mrblog_test.users' doesn't exist: SHOW FIELDS
FROM users
4)
ActiveRecord::StatementInvalid in 'User being authenticated should
require password confirmation'
Mysql::Error: Table 'mrblog_test.users' doesn't exist: SHOW FIELDS
FROM users
5)
ActiveRecord::StatementInvalid in 'User being authenticated should
require email'
Mysql::Error: Table 'mrblog_test.users' doesn't exist: SHOW FIELDS
FROM users
6)
NoMethodError in 'User being authenticated should reset password'
undefined method `[]' for nil:NilClass
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/fixtures.rb:498:in `users'
./test/spec/models/user_spec.rb:32:
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
73:in `instance_eval'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
73:in `run_example'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
23:in `run'
/opt/local/lib/ruby/1.8/timeout.rb:48:in `timeout'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:
21:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/
behaviour.rb:70:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/
behaviour.rb:67:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/
behaviour.rb:67:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:45:in `run_behaviours'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:44:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:44:in `run_behaviours'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
behaviour_runner.rb:27:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/
command_line.rb:17:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/bin/spec:3:
/opt/local/bin/spec:16:in `load'
/opt/local/bin/spec:16:
7)
NoMethodError in 'User being authenticated should not rehash password'
undefined method `[]' for nil:NilClass
8)
NoMethodError in 'User being authenticated should authenticate user'
undefined method `[]' for nil:NilClass
Finished in 0.14894 seconds
8 examples, 8 failures
On May 9, 2007, at 3:26 AM, Brian Takita wrote:
Grag,
Thanks for trying the Rspec on Merb plugin out.
Did you get any exceptions related to loading the fixtures?
Are you using the fixtures method in the Behaviour block?
Maybe it would be easier post your spec at:
http://pastie.caboo.se/
and reply with the link.
Thanks,
Brian
On 5/8/07, Gregory O'Connor < [EMAIL PROTECTED]> wrote:
Hey Brian and Ezra,
thank you both for this very interesting code.
it's exciting to easily upload a couple of 1.5G files at the same
time.
rake specs
fails for me as the fixtures/users.yml is not loaded (after editing
the test/spec/spec_helper.rb for my database).
also looking at why the progress bar doesn't work for me out of the
box. of course the file upload ability is awesome.
regards,
gregory o'connor
> On 5/4/07, Ezra Zygmuntowicz <ez at engineyard.com> wrote:
> >
> >
> > On May 4, 2007, at 3:29 PM, Brian Takita wrote:
> >
> > > A couple days ago I submitted a patch, that was committed by
Ezra,
> > > to the MrBlog project for the Rspec on Merb plugin.
> > > So far, it only works with ActiveRecord including fixtures.
> > > Has any played with it? If so, did you get it to work?
> > >
> > > I'm going to be submitting a patch for Controller specs soon. It
> > > will be very bare bones, given my current lack of
understanding of
> > > Merb controller development.
> > > View and Helper specs will follow.
> > >
> > > I saw the question on IRC, but should ROM be folded into Merb
> > > itself, or act as a plugin? There are advantages and
disadvantages
> > > to both.
> > >
> > > A pull to integrate classes into Merb is that these classes
can be
> > > reused by Test::Unit tests and Rspec.
> > > A pull to keep classes in a plugin is It can change whenever
Merb
> > > or Rspec changes. Since both Merb and Rspec are rapidly
evolving,
> > > there may be a need for the plugin for a while.
> > > Since Test::Unit is fairly static, there may not be a need to
make
> > > the Test::Unit library a plugin.
> > >
> > > One flaw with Rails, that I hope does not get repeated in
Merb, is
> > > the tight coupling with Test;:Unit (same with tight coupling
with
> > > Rspec). Of course Rspec did not exist when Rails was first
> > > developed, so this should not be much of a problem as long as we
> > > are vigilant. :)
> > >
> > > Brian
> > >
> >
> > Hey Brian-
> >
> > I was able to get the user specs running in mrblog
trunk. I
> > commited
> > a rake task to run them as 'rake specs'. The presence of a spec
> > harness makes the need for proper environments in merb urgent. I
> will
> > hack up environments with different db settings this weekend so it
> > will make testing and deving easier.
> >
> > I think that we should keep it as a plugin for a little
> while. I
> > don't want to go down the tightly coupled road in merb's testing
> > capabilities. I think there are some core helper classes I need to
> > write that could go in the framework and be used by test/unit or
> > rspec or whatver. Like a helper for making requests thru the
> > dispacther and controllers to test output without booting a
> > webserver, and some other stuff that will help with testing.
> >
> > I'd like to see the test helpers that are merb specific
> made into
> > libraries within merb that you can use from test/unit, test/
spec or
> > rspec.
> >
> > Thanks for getting this started Brian, it's a nice
> plugin. If you
> > have any questions about merb internals please feel free to ask
> and I
> > will help you grok it quickly.
>
>
> Great. Thanks Ezra.
>
> I submitted a patch for a frist stab at controller specs.
> http://merb.devjavu.com/projects/merb/ticket/45
>
> Here are some things of consideration:
>
> - response.should redirect_to and response.should
> render_template and
> not implemented yet.
> - The controller Description class has a controller_class
> accessor. If
> the first argument of describe is set to the controller class,
> the examples
> will know that the requests are for the controller.
> - I couldn't figure out how to construct the correct uri given
the
> controller and the action.
>
>
> Cheers-
> > -- Ezra Zygmuntowicz
> > -- Lead Rails Evangelist
> > -- ez at engineyard.com
> > -- Engine Yard, Serious Rails Hosting
> > -- (866) 518-YARD (9273)
> >
> >
> >
_______________________________________________
Merb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/merb-devel
_______________________________________________
Merb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/merb-devel