def METHOD_NAME(source_file, rulestring):
    """Run a roundtrip test given a sql file and a rule.
    We take a file buffer, lint, fix and lint, finally checking that
    the file fails initially but not after fixing.
    """
    if isinstance(source_file, str):
        # If it's a string, treat it as a path so lets load it.
        with open(source_file) as f:
            source_file = StringIO(f.read())
    filename = "testing.sql"
    # Lets get the path of a file to use
    tempdir_path = tempfile.mkdtemp()
    filepath = os.path.join(tempdir_path, filename)
    # Open the example file and write the content to it
    with open(filepath, mode="w") as dest_file:
        for line in source_file:
            dest_file.write(line)
    runner = CliRunner()
    # Check that we first detect the issue
    result = runner.invoke(lint, ["--rules", rulestring, "--dialect=ansi", filepath])
    assert result.exit_code == 1
    # Fix the file (in force mode)
    result = runner.invoke(
        fix, ["--rules", rulestring, "--dialect=ansi", "-f", filepath]
    )
    assert result.exit_code == 0
    # Now lint the file and check for exceptions
    result = runner.invoke(lint, ["--rules", rulestring, "--dialect=ansi", filepath])
    assert result.exit_code == 0
    shutil.rmtree(tempdir_path)