Skip to content

Instantly share code, notes, and snippets.

@mvidner
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save mvidner/433ed3c2644382853c29 to your computer and use it in GitHub Desktop.

Select an option

Save mvidner/433ed3c2644382853c29 to your computer and use it in GitHub Desktop.
#! /usr/bin/rspec
require_relative '../src/modules/IscsiLioData'
describe Yast::IscsiLioDataClass do
before :each do
@iscsilib = Yast::IscsiLioDataClass.new
@iscsilib.main()
@test_class = @iscsilib
end
describe "#SetAuth" do
context "when ..." do
it "filters out sensitive data" do
tgt = ""
tpg = -42
clnt = ""
inc = ["SECRET1"]
out = ["SECRET2"]
expect(Yast::Builtins).to receive(:y2milestone) do |*args|
expect(args.to_s).not_to match /SECRET/
end.at_least(2).times
expect(@iscsilib).
to receive(:LogExecCmd).
twice.
and_return true
expect(@iscsilib.SetAuth(tgt, tpg, clnt, inc, out)).to be true
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment