spec/spec_helper.rb in optimus-ep-0.6.9 vs spec/spec_helper.rb in optimus-ep-0.6.91
- old
+ new
@@ -4,9 +4,33 @@
#
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
# Imaging and Behavior, University of Wisconsin - Madison
module EprimeTestHelper
+
+ class RoundTrip
+ def initialize(expected)
+ @expected = expected
+ end
+
+ def matches?(target)
+ @parsed = target.parse(@expected).to_s
+ @parsed == @expected
+ end
+
+ def failure_message
+ "expected #{@parsed} to parse to #{@expected}"
+ end
+
+ def negative_failure_message
+ "Expected #{@parsed} to not parse to #{@expected}"
+ end
+ end
+
+ def round_trip(expected)
+ RoundTrip.new(expected)
+ end
+
unless constants.include?('SAMPLE_DIR')
SAMPLE_DIR = File.join(File.dirname(__FILE__), 'samples')
LOG_FILE = File.join(SAMPLE_DIR, 'optimus_log.txt')
EXCEL_FILE = File.join(SAMPLE_DIR, 'excel_tsv.txt')
BAD_EXCEL_FILE = File.join(SAMPLE_DIR, 'bad_excel_tsv.txt')
\ No newline at end of file