Guest User

Untitled

a guest
Apr 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. describe XMLAudit do
  2. describe :new do
  3. it "should take as parameters the file path of the XML file to audit and the audit event listener to parse the XML" do
  4. lambda {
  5. XMLAudit.new File.dirname(__FILE__) + "/../data/recv_audit.log", mock("Audit Listener")
  6. }.should_not raise_error
  7. end
  8.  
  9. it "should raise an error if not provided a valid file path" do
  10. lambda {
  11. XMLAudit.new "crap", mock("Audit Listener")
  12. }.should raise_error
  13. end
  14. end
  15.  
  16. describe :report do
  17.  
  18. before(:all) do
  19. @audit = XMLAudit.new RECV_AUDIT, stub_everything("Audit Listener")
  20. end
  21.  
  22. it "should support a report method" do
  23. lambda {
  24. @audit.report
  25. }.should_not raise_error
  26. end
  27.  
  28. describe "return value" do
  29. it "should be a non-nil String" do
  30. str = @audit.report
  31. str.should_not be_nil
  32. end
  33. end
  34. end
  35. end
Add Comment
Please, Sign In to add comment