spec/support/spec_addons.rb in lokalise_rails-2.0.0 vs spec/support/spec_addons.rb in lokalise_rails-3.0.0
- old
+ new
@@ -1,11 +1,16 @@
# frozen_string_literal: true
module SpecAddons
- def allow_project_id(value = '189934715f57a162257d74.88352370')
- allow(LokaliseRails).to receive(:project_id).and_return(value)
+ def expect_file_exist(path, file)
+ file_path = File.join path, file
+ expect(File.file?(file_path)).to be true
+ end
+
+ def allow_project_id(obj, value)
+ allow(obj).to receive(:project_id).and_return(value)
return unless block_given?
yield
- expect(LokaliseRails).to have_received(:project_id)
+ expect(obj).to have_received(:project_id)
end
end