Yes, that certainly did the trick...
I use
File.read("/path/to/file").should == "content"
Thanks.
2011/12/20 Michael Guterl <[email protected]>:
> On Tue, Dec 20, 2011 at 5:51 AM, Jarl Friis <[email protected]> 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
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
--
Jarl Friis
Softace ApS
RÄdhustorvet 7, 2.
3520 Farum
LinkedIn: http://dk.linkedin.com/in/jarlfriis
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users