|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
| 3 | +require "puma" |
3 | 4 | require "puma/configuration" |
4 | 5 |
|
5 | 6 | RSpec.describe Ruby::Nginx do |
|
14 | 15 | end |
15 | 16 |
|
16 | 17 | it "adds the hosts mapping" do |
17 | | - RetryExpectation.new(limit: 30, delay: 1).attempt do |
| 18 | + retry_expectation(limit: 30, delay: 1) do |
18 | 19 | hosts = File.read("/etc/hosts") |
19 | 20 | expect(hosts).to include("example.test") |
20 | 21 | end |
21 | 22 | end |
22 | 23 |
|
23 | 24 | it "creates the NGINX configuration" do |
24 | | - RetryExpectation.new(limit: 30, delay: 1).attempt do |
| 25 | + retry_expectation(limit: 30, delay: 1) do |
25 | 26 | path = File.expand_path("~/.ruby-nginx/servers/ruby_nginx_example_test.conf") |
26 | 27 | expect(File.exist?(path)).to be_truthy |
27 | 28 | end |
28 | 29 | end |
29 | 30 |
|
30 | 31 | it "creates the SSL certificate" do |
31 | | - RetryExpectation.new(limit: 30, delay: 1).attempt do |
| 32 | + retry_expectation(limit: 30, delay: 1) do |
32 | 33 | path = File.expand_path("~/.ruby-nginx/certs/_example.test.pem") |
33 | 34 | expect(File.exist?(path)).to be_truthy |
34 | 35 |
|
|
38 | 39 | end |
39 | 40 |
|
40 | 41 | it "creates the log files" do |
41 | | - RetryExpectation.new(limit: 30, delay: 1).attempt do |
| 42 | + retry_expectation(limit: 30, delay: 1) do |
42 | 43 | path = File.expand_path("~/.ruby-nginx/logs/example.test.access.log") |
43 | 44 | expect(File.exist?(path)).to be_truthy |
44 | 45 |
|
|
48 | 49 | end |
49 | 50 |
|
50 | 51 | it "successfully builds up a NGINX site" do |
51 | | - RetryExpectation.new(limit: 30, delay: 1).attempt do |
| 52 | + retry_expectation(limit: 30, delay: 1) do |
52 | 53 | html = `curl -s http://example.test` |
53 | 54 | expect(html).to include("Hello, from Ruby NGINX!") |
54 | 55 |
|
|
0 commit comments