From: Josh Cheek Date: 2012-10-01T14:21:02+09:00 Subject: Re: Setting up cucumber test framework --bcaec51970772ec46f04caf89232 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Sep 28, 2012 at 4:09 PM, Ja Tse wrote: > Hi All > > I am trying to setup a cucumber test framework which tests an > application which uses a mongodb, and I have installed the mongodb and > the I am using Mongoid as my ORM. And this is what the structure looks > like. > > . > =E2=94=9C=E2=94=80=E2=94=80 Gemfile > =E2=94=9C=E2=94=80=E2=94=80 Gemfile.lock > =E2=94=9C=E2=94=80=E2=94=80 config > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 mongoid.yml > =E2=94=9C=E2=94=80=E2=94=80 features > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 fruit_list.feature > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 lib > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 fruit_app.rb > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 step_definitions > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 support > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 env.rb > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 hooks.rb > =E2=94=94=E2=94=80=E2=94=80 spec > > 6 directories, 7 files > > Typically lib sits at the top level, and not inside of features. > However my configuration is not right because is failing: > > It would probably be helpful to explain what "is failing" actually means. Error raised (what is the error)? Tests not passing (show the test)? Personally I'd assume it has to do with Mongoid setup, but I don't know anything about Mongoid. > mongoid.yml > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > development: > sessions: > default: > database: test_mongo_db > hosts: > - localhost:27017 > > > env.rb > =3D=3D=3D=3D=3D=3D=3D > > require File.join(File.dirname(__FILE__), '..', 'lib/fruit_app' ) > require 'mongoid' > > It might be a problem to require mongoid after your app. --bcaec51970772ec46f04caf89232 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Sep 28, 2012 at 4:09 PM, Ja Tse <lists@ruby-forum.com> wrote:
Hi All

I am trying to setup a cucumber test framework which tests an
application which uses a mongodb, and I have installed the mongodb and
the I am using Mongoid as my ORM. =C2=A0And this is what the structure look= s
like.

.
=E2=94=9C=E2=94=80=E2=94=80 Gemfile
=E2=94=9C=E2=94=80=E2=94=80 Gemfile.lock
=E2=94=9C=E2=94=80=E2=94=80 config
=E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 mongoid.yml
=E2=94=9C=E2=94=80=E2=94=80 features
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 fruit_list.feature
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 lib
=E2=94=82=C2=A0=C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 fru= it_app.rb
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 step_definitions
=E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 support
=E2=94=82=C2=A0=C2=A0 =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 env.rb
=E2=94=82=C2=A0=C2=A0 =C2=A0 =C2=A0 =E2=94=94=E2=94=80=E2=94=80 hooks.rb =E2=94=94=E2=94=80=E2=94=80 spec

6 directories, 7 files


Typically lib sits at the top level, and not insi= de of features.


However my configuration is not right because is failing:


It would probably be helpful to explain what &quo= t;is failing" actually means. Error raised (what is the error)? Tests = not passing (show the test)? Personally I'd assume it has to do with Mo= ngoid setup, but I don't know anything about Mongoid.
=C2=A0
mongoid.yml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

development:
=C2=A0 sessions:
=C2=A0 =C2=A0 default:
=C2=A0 =C2=A0 =C2=A0 database: test_mongo_db
=C2=A0 =C2=A0 =C2=A0 =C2=A0 hosts:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - localhost:27017


env.rb
=3D=3D=3D=3D=3D=3D=3D

require File.join(File.dirname(__FILE__), '..', 'lib/fruit_app&= #39; )
require 'mongoid'


It might be a problem to require mongoid after yo= ur app.
--bcaec51970772ec46f04caf89232--