Skip to content

Commit

Permalink
Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Dec 2, 2021
1 parent 61cbe6b commit e00d55d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions library/general/test/popup_test.rb
Expand Up @@ -409,4 +409,23 @@
expect(subject.AnyTimedRichMessage("headline", "message", 5)).to eq nil
end
end

describe ".YesNo" do
before do
allow(ui).to receive(:OpenDialog).and_return(true)
allow(ui).to receive(:CloseDialog).and_return(true)
end

it "returns true when user clicks [Yes]" do
expect(ui).to receive(:UserInput).and_return(:yes)

expect(subject.YesNo("question")).to eq(true)
end

it "returns false when user clicks [No]" do
expect(ui).to receive(:UserInput).and_return(:no)

expect(subject.YesNo("question")).to eq(false)
end
end
end

0 comments on commit e00d55d

Please sign in to comment.