Sha256: c074731bd1d2273d352872fa84133040445377345c16a7a3ec3989c5fdfe95cd
Contents?: true
Size: 937 Bytes
Versions: 11
Compression:
Stored size: 937 Bytes
Contents
require 'rails_helper' RSpec.describe 'dummy_task' do include_context( 'rake', task_name: 'dummy_task', task_path: Spree::Core::Engine.root.join('spec/lib/tasks/dummy_task.rake'), ) it 'calls the dummy task exactly once' do expect(DummyTaskRunner).to receive(:run).once task.invoke end # This tests: # 1) that tasks get reenabled between examples # 2) that tasks aren't loaded in the wrong way, causing them to execute # an extra time for every example that's defined. # We need at least two specs to trigger the error conditions and spec order is # random so we just create the same spec twice. We could probably combine this # with the generic spec above but this seems clearer. 2.times do |i| it "still calls the dummy task exactly once when more than one example is defined - #{i}" do expect(DummyTaskRunner).to receive(:run).once task.invoke end end end
Version data entries
11 entries across 11 versions & 1 rubygems