When you set-up a .couchapprc file you can define different databases, hosts ... for different environments (see couchapp doc).
To use these set-up when running cucumber I modify the env.rb mentioned here. It use the test environment defined in .couchapprc for cucumber scenarios.
Example .couchapprc file:
Posts mit dem Label couchdb werden angezeigt. Alle Posts anzeigen
Posts mit dem Label couchdb werden angezeigt. Alle Posts anzeigen
2010-08-12
2010-08-01
BrainDump: CouchDB link cheatsheet
Note: "File" and "folder" refer to a couchapp directory structure.
{prefix} = /{db}/_design/{application}
{list_function} = name of file in lists folder (without .js)
{show_function} = name of file in shows folder (without .js)
{view_function} = name of subfolder in views folder
{prefix} = /{db}/_design/{application}
{list_function} = name of file in lists folder (without .js)
{show_function} = name of file in shows folder (without .js)
{view_function} = name of subfolder in views folder
| functionality | link | function | Read on |
|---|---|---|---|
| list | {prefix}/_list/{list_function}/{view_function} | function(head, req) | CouchDB book |
| show | {prefix}/_show/{show_function}/{doc_id} | function(doc, req) | CouchDB book |
| view | {prefix}/_view/{view_function} | map: function(doc) reduce: function(keys, values, rereduce) | intro, view parameter |
2010-07-10
Culerity, Cucumber and Couchapp - Part 2
Some further modifications in the files mentioned here were necessary to get the initial setup runable.
(System configuration: WinXP, JRuby 1.5.1, CouchDB 0.11, couchapp 0.6.2)
After this modifications I got:
(System configuration: WinXP, JRuby 1.5.1, CouchDB 0.11, couchapp 0.6.2)
- step_definitions/common_culerity_steps.rb - add this
- def couchapp
- 'rem' # enter your couchapp name here
- end
- support/paths.rb - modify
Before:
After:- when /start page/
- "/#{database}/_design/#{database}/index.html"
- else
- when /start page/
- "/#{database}/_design/#{couchapp}/index.html"
- else
- step_definitions/common_culerity_steps.rb - remove ":resynchronize => true," from
- $browser = Culerity::RemoteBrowserProxy.new $server, {
- :browser => :firefox,
- :javascript_exceptions => true,
- :resynchronize => true,
- :status_code_exceptions => true}
- start_page.feature - modify the example scenario to
- Scenario: go to the start page
- When I go to the start page
- Then I should see the text "Generated CouchApp"
After this modifications I got:
E:\projects\privat\rem>jruby -S cucumber --no-color
Feature: start page
In order to feel welcome
As a user
I want to be welcomed on the start page
Scenario: go to the start page # features\start_page.feature:7
2010-07-10 17:01:12 [INFO] Visit your CouchApp here:
http://localhost:5984/hejhej/_design/rem/index.html
When I go to the start page # features/step_definitions/common_culerity_steps.rb:90
Then I should see the text "Generated CouchApp" # features/step_definitions/common_culerity_steps.rb:119
1 scenario (1 passed)
2 steps (2 passed)
0m8.625s
E:\projects\privat\rem>
2010-07-09
Culerity, Cucumber and Couchapp
Starting a new couchapp application I want to try BDD. I found a small tutorial how to testing couchapps with cucumber and culerity. Unfortunatly I have to deal with WinXP, and so I run into some trouble because the culerity server doesn't start. Finally I can solve it by insert "jruby " in culerity-0.2.10/lib/culerity.rb, line 28.
Before:
Before:
def self.run_server IO.popen(File.dirname(__FILE__) + "/../bin/run_celerity_server.rb", 'r+').extend(ServerCommands) endAfter:
def self.run_server
IO.popen("jruby " + File.dirname(__FILE__) + "/../bin/run_celerity_server.rb", 'r+').extend(ServerCommands)
end
2009-12-10
CouchDB API: Inspect parameter
Labels:
couchdb
While playing with couchdb/couchapp often I want to inspect api function parameter. Javascript does not provide a buildin function to do some inspection but this one does a good job. After removing the logging stuff it can be used e.g. to inspect show function parameter.
Inspection show function can be found here.
Inspection show function can be found here.
2009-11-03
CouchDB auf WinXP
- Installationspaket gibts hier
- Nach dem Installieren müssen noch in >installdir</bin/erl.ini zwei Pfade angepasst werden
- [Update]in couchdb.bat musste ich noch in der Zeile nach "setlocal"
%~d0
einfügen
Und dann ...
D:\Programme\CouchDB\bin>couchdb.bat
CouchDB 0.11.0b819947 - prepare to relax...
Eshell V5.7.2 (abort with ^G)
1> Apache CouchDB 0.11.0b819947 (LogLevel=info) is starting.
1> Apache CouchDB has started. Time to relax.
1> [info] [<0.35.0>] Apache CouchDB has started on http://127.0.0.1:5984/
bzw.
Abonnieren
Posts (Atom)