Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. require 'day7'
  2.  
  3. describe "Integration Test" do
  4. subject(:d) { Day7.new }
  5. before(:each) do
  6. @f = File.read("lib/input.txt")
  7. @f2 = File.read("lib/input2.txt")
  8. @RESULT1 = 16076
  9. @RESULT2 = 2797
  10. end
  11.  
  12. it "calculates the right signal for challenge 1" do
  13. lines = @f.split("\n")
  14. d.reverse_data
  15. d.sort_file
  16. d.trim
  17. d.convert_to_hash
  18. expect(d.process_signals).to eq @RESULT1
  19. end
  20.  
  21. it "calculates the right signal for challenge 2" do
  22. lines = @f2.split("\n")
  23. d.reverse_data
  24. d.sort_file
  25. d.trim
  26. d.convert_to_hash
  27. expect(d.process_signals).to eq @RESULT1
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement