I actually wouldn't attempt to mock the file system stuff since it's not something that you own.  There are a couple of ways that I would do it.  I think I would start by separating reading from the files from doing the comparison.  That way you can test the comparison in isolation.  In all reality you probably don't have to worry about testing the filereading process since that's "owned" by the ruby core team.  These are the two ways that I would approach it:

```ruby
# The instance way
class Comparator
  def initialize(arr, set)
    @arr = arr
    @set = set
  end

  def comparison
    @arr - @set.to_a
  end
end

# The class method way
class comparator
  def self.compare(arr, set)
    arr - set.to_a
  end
end

Obviously they both have pros and cons.