   describe "write/3" do
     # @tag :pending
     test "returns ok tuple if function succeeds" do
-      assert {:ok, @equation} == RPNCalculator.Output.write(@resource, @filename, @equation)
+      resource = __MODULE__
+      filename = "filename"
+      equation = "1 1 +"
+
+      assert {:ok, equation} == RPNCalculator.Output.write(resource, filename, equation)
     end
 
     @tag :pending


  import ExUnit.CaptureIO

  @resource __MODULE__
  @filename "filename"
  @bad_filename "bad_filename"
  @equation "1 1 +"

  def open(filename \\ "<nil>") do
    send(self(), {:open, filename})

    case filename do
      @filename -> {:ok, :stdio}
      @bad_filename -> {:ok, spawn(fn -> nil end)}
    end
  end


    E.g.) resource.close(filename)
    """
    test "closes resource" do
      resource = __MODULE__
      filename = "filename"
      equation = "1 1 +"

      RPNCalculator.Output.write(resource, filename, equation)
      assert_received :close, @use_close_error_message
    end

    @tag :pending
    test "rescues and returns error tuple from raised error" do
      resource = __MODULE__
      bad_filename = "bad_filename"
      equation = "1 1 +"

      assert {:error, "Unable to write to resource"} ==
               RPNCalculator.Output.write(resource, bad_filename, equation)
    end

    @tag :pending
    test "closes resource even when rescuing from raised error" do
      resource = __MODULE__
      bad_filename = "bad_filename"
      equation = "1 1 +"

      RPNCalculator.Output.write(resource, bad_filename, equation)
      assert_received :close, "write/3 should close the `resource` even if an error is raised"
    end
  end
