Sha256: e4fa68db5e1a9c552c2b520f433f7f0e4c6d0bfd4b1682e6ef6b7e02d90e57d9

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 KB

Contents

shared_examples "a scan result" do
  it "should have a raw result" do
    expect(subject.raw).not_to be_nil
  end
  it "should have a version" do
    expect(subject.version).not_to be_nil
  end
  it "should have a scanned_at time" do
    expect(subject.scanned_at).to be_a(Time)
  end
  it "should have a string representation" do
    expect(subject.to_s).not_to be_nil
  end
end

shared_examples "a successful scan result" do
  it "should not have a virus" do
    expect(subject.virus_found).to be_nil
    expect(subject).not_to have_virus
  end
  it "should not have an error" do
    expect(subject).not_to be_error
  end
  it "should be ok" do
    expect(subject).to be_ok
  end
end

shared_examples "an error scan result" do
  it "should have an error" do
    expect(subject).to be_error
  end
  it "shoud not have a virus" do
    expect(subject.virus_found).to be_nil
    expect(subject).not_to have_virus
  end
  it "should not be ok" do
    expect(subject).not_to be_ok
  end
end

shared_examples "a virus scan result" do
  it "shoud have a virus" do
    expect(subject.virus_found).not_to be_nil
    expect(subject).to have_virus
  end
  it "should not have an error" do
    expect(subject).not_to be_error
  end
  it "should not be ok" do
    expect(subject).not_to be_ok
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ddr-antivirus-1.3.3 spec/shared_examples_for_scan_results.rb
ddr-antivirus-1.3.2 spec/shared_examples_for_scan_results.rb
ddr-antivirus-1.3.1 spec/shared_examples_for_scan_results.rb
ddr-antivirus-1.3.0 spec/shared_examples_for_scan_results.rb
ddr-antivirus-1.2.1 spec/shared_examples_for_scan_results.rb
ddr-antivirus-1.2.0 spec/shared_examples_for_scan_results.rb