Skip to content

Commit

Permalink
Allow stubbing stdin in msfupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
bturner-r7 committed Nov 15, 2013
1 parent faf8099 commit e6c43bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion msfupdate
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ end


class Msfupdate
attr_reader :stdin
attr_reader :stdout
attr_reader :stderr

def initialize(msfbase_dir, stdout=$stdout, stderr=$stderr)
def initialize(msfbase_dir, stdin=$stdin, stdout=$stdout, stderr=$stderr)
@msfbase_dir = msfbase_dir
@stdin = stdin
@stdout = stdout
@stderr = stderr
end
Expand Down
3 changes: 2 additions & 1 deletion spec/msfupdate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ def dummy_apt_pathname
dummy_git_pathname
end

let(:stdin) { StringIO.new("", "rb") }
let(:stdout) { StringIO.new("", "wb") }
let(:stderr) { StringIO.new("", "wb") }

subject do
Msfupdate.new(msfbase_dir, stdout, stderr)
Msfupdate.new(msfbase_dir, stdin, stdout, stderr)
end

before(:all) do
Expand Down

0 comments on commit e6c43bf

Please sign in to comment.