honkster-fasterer-csv 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.7.2
data/lib/fasterer_csv.rb CHANGED
@@ -128,7 +128,7 @@ module FastererCSV
128
128
  end
129
129
 
130
130
  def headers
131
- @table.headers
131
+ @headers ||= @table.headers.dup
132
132
  end
133
133
 
134
134
  attr_reader :line
@@ -117,6 +117,17 @@ a,b,c,d,e,f,g,h,i,j,k,l,m,
117
117
  row["b"].should == "1"
118
118
 
119
119
  end
120
+
121
+ it "allows mutation of rows" do
122
+ each_called = false
123
+ table = FastererCSV.parse(@data).each do |row|
124
+ each_called = true
125
+ row[:foo] = "bar"
126
+ row.headers.should == [:a, :b, :c,:d,:e,:f,:g,:h,:i,:j,:k,:l,:m,:_, :foo]
127
+ end
128
+ each_called.should be_true
129
+ table.headers.should == [:a, :b, :c,:d,:e,:f,:g,:h,:i,:j,:k,:l,:m,:_]
130
+ end
120
131
  end
121
132
 
122
133
  describe "read" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honkster-fasterer-csv
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 1
10
- version: 1.7.1
9
+ - 2
10
+ version: 1.7.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mason