Skip to content

Commit d404c75

Browse files
committed
require dsl with default require, but make include optional
1 parent 1417ec3 commit d404c75

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

lib/sshkit/all.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
require_relative 'configuration'
1010
require_relative 'coordinator'
1111

12+
require_relative 'dsl'
13+
1214
require_relative 'exception'
1315

1416
require_relative 'logger'

lib/sshkit/dsl.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ def run_locally(&block)
1313
end
1414

1515
end
16-
17-
include SSHKit::DSL

test/unit/test_dsl.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require 'helper'
2+
3+
module SSHKit
4+
5+
class TestDSL < UnitTest
6+
include SSHKit::DSL
7+
8+
def test_dsl_on
9+
coordinator = mock
10+
Coordinator.stubs(:new).returns coordinator
11+
coordinator.expects(:each).at_least_once
12+
13+
on('1.2.3.4')
14+
end
15+
16+
def test_dsl_run_locally
17+
local_backend = mock
18+
Backend::Local.stubs(:new).returns local_backend
19+
local_backend.expects(:run).at_least_once
20+
21+
run_locally
22+
end
23+
24+
end
25+
26+
end

0 commit comments

Comments
 (0)