fakefs 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjI0YTBmYzk5YzJiYzllMDgxYTRkZTY5N2M2ZGVjZmM4ZDUzMjFiNw==
4
+ M2Q1M2IzMDYzOTczY2E4NjFkZGRhYWRhMTI2ZTQxNzZkYjNlZGE0Ng==
5
5
  data.tar.gz: !binary |-
6
- MjBjMTVhNTk1ZjliZjFiODcxZWYxMGMxMDE0ODA3Zjk4MWRjZWUzZg==
6
+ YzFhYTRmZmU1NTY3MWJlZTljZjkyZTBjMmQ4NjBiZWZhNDBiNDg1YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTM1ZmFjZjkxMDQ4M2Q5ZWIxMGU1N2UwMDc4YzAzYWJmYTg1ZDdmZmUzZmVk
10
- YTZlOWUwYmY3MWE1MWExNDE2YzI0YzM0NmM0ZTQ3MDE1OGVjYWU1OTVmMjUx
11
- M2UzNjkxNGIzMzE2Yzc0ODU1NDZhYTE1ZTI2ZGJlNjBkNTkxOGQ=
9
+ YjgzZWNjYjA2NjliMzE3ZmFiOTY4NTE0N2UyODI0ZWI2YjE4MjU2NDE1NGNh
10
+ YzIzYTc0YmFlMThjYmY5Yjk4OWQwZWM0ZTU2YTI4ZGJiNDEzNzA3M2NkYjEy
11
+ YzljYmJiY2EzOGNiNTBhZTdkOWY5M2FmZjEzZWFmNDQ4ODg1ZGI=
12
12
  data.tar.gz: !binary |-
13
- YjAzZTNiMzYyOTBjNTlkMzc5MDQ4MzZjZDIwZDdlN2I4OTJhODAzNDJkYzg0
14
- N2UyNzA3NDY0ZjY4ZWZmYTUwMWZkZTAyYjFkZjg1ODRmODQ4MmFkMWE0N2Rk
15
- MzM1ZDMwMzJmMTFlNWNmNjAzNGI5ZDQ2ZDJmOWM5YmNmZTAyZTI=
13
+ ODRiYzE1NjBhZjRjMGVhNTE1YWE1ZmM0YmRjMjZkNzAwNDcwYTkzNjRmNjJh
14
+ MDNkODk2MzVlNTVhZWVmODFjNjhkMTEzNGZjNGYyOGNiODFhMzg3YThhOTg4
15
+ N2E3Y2JlM2I3NzI2ZWQ1YTY1ZjNkMzhhYzc2ZTgzYzU0ZjY1MTQ=
data/CONTRIBUTORS CHANGED
@@ -17,10 +17,10 @@ Víctor Martínez <knoopx@gmail.com>
17
17
  Mariusz Pietrzyk <wijet@wijet.pl>
18
18
  John Firebaugh <john.firebaugh@gmail.com>
19
19
  Sebastian Boehm <sebastian@sometimesfood.org>
20
+ Dan Duvall <dduvall@wikimedia.org>
20
21
  Carlos Pardo <cpardo@altavistaed.com>
21
22
  AlphaHydrae <hydrae.alpha@gmail.com>
22
23
  Nick Quaranto <nick@quaran.to>
23
- Dan Duvall <dduvall@wikimedia.org>
24
24
  Toby Ovod-Everett <toby@ovod-everett.org>
25
25
  Aaron Suggs <aaron@ktheory.com>
26
26
  Victor Costan <costan@gmail.com>
@@ -47,9 +47,9 @@ Emil Soman <emil.soman@gmail.com>
47
47
  Ryan McGeary <ryan@mcgeary.org>
48
48
  Matt Todd <chiology@gmail.com>
49
49
  Noah Paessel <knowuh@gmail.com>
50
+ Jakub Jirutka <jakub@jirutka.cz>
50
51
  dmathieu <42@dmathieu.com>
51
52
  Oleg Sukhodolsky <os97673@gmail.com>
52
- Jakub Jirutka <jakub@jirutka.cz>
53
53
  Winston Lee <lee.winston@gmail.com>
54
54
  Radek Simko <radek.simko@gmail.com>
55
55
  Grayson Wright <wright.grayson@gmail.com>
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- FakeFS [![build status](https://secure.travis-ci.org/defunkt/fakefs.png)](https://secure.travis-ci.org/defunkt/fakefs)
1
+ FakeFS [![build status](https://secure.travis-ci.org/defunkt/fakefs.svg?branch=master)](https://secure.travis-ci.org/defunkt/fakefs)
2
2
  ======
3
3
 
4
4
  Mocha is great. But when your library is all about manipulating the
@@ -629,8 +629,12 @@ module FakeFS
629
629
  # This method has existed since 1.8.1.
630
630
  #
631
631
  def each_line(*args, &block) # :yield: line
632
- File.open(@path, 'r') do |io|
633
- io.each_line(*args, &block)
632
+ if block_given?
633
+ File.open(@path, 'r') do |io|
634
+ io.each_line(*args, &block)
635
+ end
636
+ else
637
+ enum_for(:each_line, *args)
634
638
  end
635
639
  end
636
640
 
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '0.6.4'
4
+ VERSION = '0.6.5'
5
5
 
6
6
  def self.to_s
7
7
  VERSION
@@ -34,37 +34,39 @@ class FakePathnameTest < Test::Unit::TestCase
34
34
  end
35
35
 
36
36
  def test_io_each_line_without_block_returns_enumerator
37
- File.write(@path, '')
37
+ File.write(@path, "one\ntwo\nthree\n")
38
38
 
39
39
  assert @pathname.each_line.is_a?(Enumerator)
40
+ assert_equal %w(o t t), @pathname.each_line.map { |l| l[0] }
41
+ assert_equal ["one\ntwo\nth", "ree\n"], @pathname.each_line('th').to_a
40
42
  end
41
43
 
42
44
  def test_io_read_returns_file_contents
43
45
  File.write(@path, "some\ncontent")
44
46
 
45
- assert_equal @pathname.read, "some\ncontent"
46
- assert_equal @pathname.read(6), "some\nc"
47
- assert_equal @pathname.read(4, 3), "e\nco"
47
+ assert_equal "some\ncontent", @pathname.read
48
+ assert_equal "some\nc", @pathname.read(6)
49
+ assert_equal "e\nco", @pathname.read(4, 3)
48
50
  end
49
51
 
50
52
  def test_io_binread_returns_file_contents
51
53
  File.write(@path, "some\ncontent")
52
54
 
53
- assert_equal @pathname.binread, "some\ncontent"
54
- assert_equal @pathname.binread(6), "some\nc"
55
- assert_equal @pathname.binread(4, 3), "e\nco"
55
+ assert_equal "some\ncontent", @pathname.binread
56
+ assert_equal "some\nc", @pathname.binread(6)
57
+ assert_equal "e\nco", @pathname.binread(4, 3)
56
58
  end
57
59
 
58
60
  def test_io_binread_reads_contents_as_binary
59
61
  File.write(@path, "some\ncontent")
60
62
 
61
- assert_equal @pathname.binread.encoding.name, 'ASCII-8BIT'
63
+ assert_equal 'ASCII-8BIT', @pathname.binread.encoding.name
62
64
  end
63
65
 
64
66
  def test_io_readlines_returns_array_of_lines
65
67
  File.write(@path, "one\ntwo\nthree\n")
66
68
 
67
- assert_equal @pathname.readlines, ["one\n", "two\n", "three\n"]
69
+ assert_equal ["one\n", "two\n", "three\n"], @pathname.readlines
68
70
  end
69
71
 
70
72
  def test_io_sysopen_is_unsupported
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakefs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-01-15 00:00:00.000000000 Z
15
+ date: 2015-02-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project:
146
- rubygems_version: 2.4.5
146
+ rubygems_version: 2.2.2
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: A fake filesystem. Use it in your tests.