Yes, that certainly did the trick...
I use
File.read("/path/to/file").should == "content"
Thanks.
2011/12/20 Michael Guterl <mguterl at gmail.com>:> On Tue, Dec 20, 2011 at 5:51 AM, Jarl Friis <jarl at softace.dk>
wrote:
>> Hi.
>>
>> Is there any matcher for test file content, anything like
>>
>> file("/path/to/file.txt").should contain("File
content")
>> or
>> file("/path/to/file.txt").content.should == "File
content"
>> or
>> file_content("/path/to/file.txt").should == "File
content"
>>
>> or something else?
>>
> File.read("/path/to/file") will give you a string of the entire
> contents of the file.
>
> File.read("/path/to/file").should match "content"
> File.read("/path/to/file").should include "content"
>
> etc.
>
> Does that help?
>
> Best,
> Michael Guterl
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
--
Jarl Friis
Softace ApS
R?dhustorvet 7, 2.
3520 Farum
LinkedIn: http://dk.linkedin.com/in/jarlfriis