To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorSimple usage example
- Background
-
- Given
-
a file named "Conffile" with:
mongodb do host String, 'Host to connect to MongoDB' => 'localhost' port Fixnum, 'MongoDB port' => 27017 end
- And
-
a file named "my_app.rb" with:
require 'appsent' AppSent.init :path => 'config', :env => 'production' puts 'All stuff work!'
- Scenarios
-
- config does not exist
- Config has no environment
- required parameteres do not specified
- Some parameter is wrong type
- All config present and have right values
- config does not exist
-
- When
-
I run
ruby my_app.rb
- Then
-
the output should contain:
missing config file 'config/mongodb.yml'
- Config has no environment
-
- When
- I add file named "config/mongodb.yml"
- And
-
I run
ruby my_app.rb
- Then
-
the output should contain:
config file 'config/mongodb.yml' has no 'production' environment
- required parameteres do not specified
-
- When
-
I write to "config/mongodb.yml" with:
production: optional_value: temp
- And
-
I run
ruby my_app.rb
- Then
-
the output should contain:
wrong config file 'config/mongodb.yml': host: localhost # does not exist(Host to connect to MongoDB), String port: 27017 # does not exist(MongoDB port), Fixnum
- Some parameter is wrong type
-
- When
-
I write to "config/mongodb.yml" following:
production: host: 100500 port: 27017
- And
-
I run
ruby my_app.rb
- Then
-
the output should contain:
wrong config file 'config/mongodb.yml': host: 100500 # wrong type,should be String(Host to connect to MongoDB)
- All config present and have right values
-
- When
-
I write to "config/mongodb.yml" following:
production: host: 'somehost.com' port: 27017
- And
-
I run
ruby my_app.rb
- Then
-
the output should contain:
All stuff work!
Last published over 7 years ago by kucaahbe.