Skip to content

Commit 525f458

Browse files
committed
Improve TESTING documentation
1 parent 0b7e92f commit 525f458

File tree

1 file changed

+50
-35
lines changed

1 file changed

+50
-35
lines changed

Diff for: TESTING.md

+50-35
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,6 @@
11
Testing
22
=======
33

4-
## Required Gems
5-
6-
* `yard`
7-
* `vagrant`
8-
* `foodcritic`
9-
* `rubocop`
10-
* `berkshelf`
11-
* `simplecov`
12-
* `should_not`
13-
* `chefspec`
14-
* `test-kitchen`
15-
* `kitchen-vagrant`
16-
17-
### Required Gems for Guard
18-
19-
* `guard`
20-
* `guard-foodcritic`
21-
* `guard-rubocop`
22-
* `guard-rspec`
23-
* `guard-kitchen`
24-
25-
More info at [Guard Readme](https://github.com/guard/guard#readme).
26-
274
## Installing the Requirements
285

296
You must have [VirtualBox](https://www.virtualbox.org/) and [Vagrant](http://www.vagrantup.com/) installed.
@@ -35,17 +12,40 @@ You can install gem dependencies with bundler:
3512

3613
## Generating the Documentation
3714

15+
This will generate the documentation for the source files inside the [*libraries/*](https://github.com/zuazo/ssl_certificate-cookbook/tree/master/libraries) directory.
16+
3817
$ bundle exec rake doc
3918

40-
## Running the Syntax Style Tests
19+
The documentation is included in the source code itself.
20+
21+
## Syntax Style Tests
22+
23+
We use the following tools to test the code style:
24+
25+
* [RuboCop](https://github.com/bbatsov/rubocop#readme)
26+
* [foodcritic](http://www.foodcritic.io/)
27+
28+
To run the tests:
4129

4230
$ bundle exec rake style
4331

44-
## Running the Unit Tests
32+
## Unit Tests
33+
34+
We use [ChefSpec](https://github.com/sethvargo/chefspec#readme) and [RSpec](http://rspec.info/) for the unit tests. RSpec is generally used to test the libraries or some Ruby specific code.
35+
36+
The unit test files are placed in the [*test/unit/*](https://github.com/zuazo/ssl_certificate-cookbook/tree/master/test/unit) directory.
37+
38+
To run the tests:
4539

4640
$ bundle exec rake unit
4741

48-
## Running the Integration Tests
42+
## Integration Tests
43+
44+
We use [Test Kitchen](http://kitchen.ci/) to run the tests and the tests are written using [Serverspec](http://serverspec.org/).
45+
46+
The integration test files are placed in the [*test/integration/*](https://github.com/zuazo/ssl_certificate-cookbook/tree/master/test/integration) directory. Some cookbooks required by this tests are in the [*test/cookbooks/*](https://github.com/zuazo/ssl_certificate-cookbook/tree/master/test/cookbooks) directory.
47+
48+
To run the tests:
4949

5050
$ bundle exec rake integration:vagrant
5151

@@ -55,24 +55,21 @@ Or:
5555
$ bundle exec kitchen test
5656
[...]
5757

58-
### Running Integration Tests in Docker
58+
### Integration Tests in Docker
5959

60-
You need to have [Docker installed](https://docs.docker.com/installation/).
60+
You can run the integration tests using [Docker](https://www.docker.com/) instead of Vagrant if you prefer.
61+
62+
Of course, you need to have [Docker installed](https://docs.docker.com/engine/installation/).
6163

6264
$ wget -qO- https://get.docker.com/ | sh
6365

6466
Then use the `integration:docker` rake task to run the tests:
6567

6668
$ bundle exec rake integration:docker
6769

68-
### Running Integration Tests in the Cloud
69-
70-
#### Requirements
70+
### Integration Tests in the Cloud
7171

72-
* `kitchen-digitalocean`
73-
* `kitchen-ec2`
74-
75-
You can run the tests in the cloud instead of using vagrant. First, you must set the following environment variables:
72+
You can run the tests in the cloud instead of using Vagrant. First, you must set the following environment variables:
7673

7774
* `AWS_ACCESS_KEY_ID`
7875
* `AWS_SECRET_ACCESS_KEY`
@@ -85,3 +82,21 @@ You can run the tests in the cloud instead of using vagrant. First, you must set
8582
Then use the `integration:cloud` rake task to run the tests:
8683

8784
$ bundle exec rake integration:cloud
85+
86+
## Guard
87+
88+
Guard is a tool that runs the tests automatically while you are making changes to the source files.
89+
90+
To run Guard:
91+
92+
$ guard
93+
94+
More info at [Guard Readme](https://github.com/guard/guard#readme).
95+
96+
## Available Rake Tasks
97+
98+
There are multiple Rake tasks that you can use to run the tests:
99+
100+
$ rake -T
101+
102+
See [Rakefile documentation](https://github.com/ruby/rake/blob/master/doc/rakefile.rdoc) for more information.

0 commit comments

Comments
 (0)