features/step_definitions/expandsync_steps.rb in expandsync-0.1.0 vs features/step_definitions/expandsync_steps.rb in expandsync-0.1.1

- old
+ new

@@ -1,20 +1,15 @@ -require 'nori' - -Given(/^an aText CSV file at "(.*?)"$/) do |atext_input| - Dir.chdir(File.dirname(atext_input)) do - FileUtils.cp(File.join(TMP_DIR, 'atext.csv'), 'atext.csv') - FileUtils.cp(File.join(TMP_DIR, 'expected-new-textexpander.xml'), 'expected-new-textexpander.xml') - FileUtils.cp(File.join(TMP_DIR, 'Settings.textexpander'), '/tmp/expandsync/Dropbox/TextExpander/Settings.textexpander') - end +Given(/^a file located at "(.*?)"$/) do |filepath| + expect(File).to exist(File.expand_path(filepath)) end Then(/^"(.*?)" should exist$/) do |file| expect(File).to exist(File.expand_path(file)) end -Then(/^"(.*?)" should be the same as "(.*?)"$/) do |file1, file2| - parser = Nori.new - file1_xml = parser.parse(File.read(File.expand_path(file1))) - file2_xml = parser.parse(File.read(File.expand_path(file2))) - expect(file1_xml).to eq(file2_xml) +Then(/^Settings\.textexpander should be backed up$/) do + expect(File).to exist("/tmp/expandsync/Dropbox/TextExpander/Settings.textexpander_#{ Time.now.utc.iso8601 }") +end + +Then(/^Settings\.textexpander should not be backed up$/) do + expect(File).to_not exist("/tmp/expandsync/Dropbox/TextExpander/Settings.textexpander_#{ Time.now.utc.iso8601 }") end \ No newline at end of file