Sha256: 133bc76966f1ebbd2f49e4756812f50fc3e3e48ce624f77f8056bb6a21ef08e4
Contents?: true
Size: 1.05 KB
Versions: 20
Compression:
Stored size: 1.05 KB
Contents
describe LinuxAdmin::EtcIssue do subject { described_class.instance } before do # Reset the singleton so subsequent tests get a new instance subject.refresh end it "should not find the phrase when the file is missing" do expect(File).to receive(:exist?).with('/etc/issue').at_least(:once).and_return(false) expect(subject).not_to include("phrase") end it "should not find phrase when the file is empty" do etc_issue_contains("") expect(subject).not_to include("phrase") end it "should not find phrase when the file has a different phrase" do etc_issue_contains("something\nelse") expect(subject).not_to include("phrase") end it "should find phrase in same case" do etc_issue_contains("phrase") expect(subject).to include("phrase") end it "should find upper phrase in file" do etc_issue_contains("PHRASE\nother") expect(subject).to include("phrase") end it "should find phrase when searching with upper" do etc_issue_contains("other\nphrase") expect(subject).to include("PHRASE") end end
Version data entries
20 entries across 20 versions & 1 rubygems