Sha256: 43ff221a6ea773ac0bce20e0229708f0b3dfbc503e302b1a56eb71c346b2d289
Contents?: true
Size: 930 Bytes
Versions: 30
Compression:
Stored size: 930 Bytes
Contents
require 'spec_helper' 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
30 entries across 30 versions & 1 rubygems