Skip to content

Commit 03e4a29

Browse files
committed
One method for checking if testing with ssl locally
1 parent 00cd021 commit 03e4a29

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spec/mongo/socket/ssl_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
end
4747
end
4848

49-
context 'when a CA certificate is provided', if: running_ssl? && testing_locally? do
49+
context 'when a CA certificate is provided', if: testing_ssl_locally? do
5050

5151
let(:options) do
5252
{
@@ -67,7 +67,7 @@
6767
end
6868
end
6969

70-
context 'when a CA certificate is not provided', if: running_ssl? && testing_locally? do
70+
context 'when a CA certificate is not provided', if: testing_ssl_locally? do
7171

7272
let(:options) do
7373
{
@@ -88,7 +88,7 @@
8888
end
8989
end
9090

91-
context 'when ssl_verify is not specified' do
91+
context 'when ssl_verify is not specified', if: testing_ssl_locally? do
9292

9393
let(:options) do
9494
{
@@ -108,7 +108,7 @@
108108
end
109109
end
110110

111-
context 'when ssl_verify is true' do
111+
context 'when ssl_verify is true', if: testing_ssl_locally? do
112112

113113
let(:options) do
114114
{

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def list_command_enabled?
152152
# Is the test suite running locally (not on Travis or Jenkins).
153153
#
154154
# @since 2.1.0
155-
def testing_locally?
156-
!(ENV['CI'] || ENV['JENKINS_HOME'])
155+
def testing_ssl_locally?
156+
running_ssl? && !(ENV['CI'] || ENV['JENKINS_CI'])
157157
end
158158

159159
# Is the test suite running on SSL.

0 commit comments

Comments
 (0)