def check_file_contents(filename, expected_text):
    """Checks that the given file contains the expected text.
    
    Parameters
    ----------
    filename : str
        Name of file to check
    expected_text : str
        Expected contents of file
    
    Returns
    -------
    list
        :obj:`list` of unexpected lines
    """

    # Read the file
    with open(filename, 'r') as fid:
        lines = fid.readlines()

    # Initialize a list of failures
    failures = []

    # Loop through lines
    for actual_line, expected_line, line_num in zip(lines, expected_text.split('\n'), range(len(lines))):
        expected_line += '\n'

        # Test if lines are equal
        if actual_line != expected_line:
            failures.append('Unexpected file contents (line {}): ACTUAL: {} -- EXPECTED: {}'.format(line_num, actual_line, expected_line))
    
    return failures