You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: capture_test.rb
    path of file: ./repos/workarea/core/test/models/workarea/inventory
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  module Inventory
    class CaptureTest < TestCase
      setup :set_sku

      def set_sku
        @sku = create_inventory(
          id: 'SKU1',
          policy: 'allow_backorder',
          available: 1,
          ba
    
      def test_handles_a_failure
        capture = Capture.new(@sku, 1, 1)
        Sku.update_all(available: 0, backordered: 0, sellable: 0)
        capture.perform

        refute(capture.result[:success])
        assert_equal(0, capture.result[:available])
        assert_equal(0, capture.result[:backordered])

        @sku.reload
        assert_equal(0, @sku.available)
        assert_equal(0, @sku.backordered)
        assert_equal(0, @sku.sellable)
        assert_equal(0, @sku.purchased)
      end