Skip to content

Commit

Permalink
require dsl with default require, but make include optional
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrichartz committed Feb 22, 2016
1 parent 6de1e10 commit b76a86c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/sshkit/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require_relative 'coordinator'

require_relative 'deprecation_logger'
require_relative 'dsl'

require_relative 'exception'

Expand All @@ -35,4 +36,4 @@
require_relative 'backends/printer'
require_relative 'backends/netssh'
require_relative 'backends/local'
require_relative 'backends/skipper'
require_relative 'backends/skipper'
2 changes: 0 additions & 2 deletions lib/sshkit/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ def run_locally(&block)
end

end

include SSHKit::DSL
26 changes: 26 additions & 0 deletions test/unit/test_dsl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'helper'

module SSHKit

class TestDSL < UnitTest
include SSHKit::DSL

def test_dsl_on
coordinator = mock
Coordinator.stubs(:new).returns coordinator
coordinator.expects(:each).at_least_once

on('1.2.3.4')
end

def test_dsl_run_locally
local_backend = mock
Backend::Local.stubs(:new).returns local_backend
local_backend.expects(:run).at_least_once

run_locally
end

end

end

0 comments on commit b76a86c

Please sign in to comment.