comma 4.2.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +10 -1
  3. data/.rubocop_todo.yml +3 -364
  4. data/.travis.yml +36 -55
  5. data/Appraisals +14 -1
  6. data/Gemfile +2 -0
  7. data/Gemfile.lock +19 -16
  8. data/README.md +2 -2
  9. data/Rakefile +2 -0
  10. data/comma.gemspec +13 -11
  11. data/gemfiles/{active4.1.16.gemfile → active4.2.11.1.gemfile} +2 -2
  12. data/gemfiles/{active4.2.8.gemfile.lock → active4.2.11.1.gemfile.lock} +43 -38
  13. data/gemfiles/{active4.0.13.gemfile → active5.0.7.2.gemfile} +2 -2
  14. data/gemfiles/{active5.0.1.gemfile.lock → active5.0.7.2.gemfile.lock} +44 -40
  15. data/gemfiles/{active5.1.0.gemfile → active5.1.7.gemfile} +2 -2
  16. data/gemfiles/{active5.1.0.gemfile.lock → active5.1.7.gemfile.lock} +44 -40
  17. data/gemfiles/{active4.2.8.gemfile → active5.2.3.gemfile} +2 -2
  18. data/gemfiles/active5.2.3.gemfile.lock +108 -0
  19. data/gemfiles/{active5.0.1.gemfile → active6.0.0.gemfile} +2 -2
  20. data/gemfiles/{active5.2.0.gemfile.lock → active6.0.0.gemfile.lock} +31 -29
  21. data/gemfiles/{rails4.1.16.gemfile → rails4.2.11.1.gemfile} +1 -1
  22. data/gemfiles/{rails4.2.8.gemfile.lock → rails4.2.11.1.gemfile.lock} +84 -80
  23. data/gemfiles/{rails4.0.13.gemfile → rails5.0.7.2.gemfile} +1 -1
  24. data/gemfiles/rails5.0.7.2.gemfile.lock +198 -0
  25. data/gemfiles/{rails5.1.0.gemfile → rails5.1.7.gemfile} +1 -1
  26. data/gemfiles/rails5.1.7.gemfile.lock +198 -0
  27. data/gemfiles/{rails5.2.0.gemfile → rails5.2.3.gemfile} +1 -1
  28. data/gemfiles/{rails5.2.0.gemfile.lock → rails5.2.3.gemfile.lock} +82 -80
  29. data/gemfiles/{rails4.2.8.gemfile → rails6.0.0.gemfile} +1 -1
  30. data/gemfiles/rails6.0.0.gemfile.lock +237 -0
  31. data/init.rb +2 -0
  32. data/lib/comma.rb +23 -33
  33. data/lib/comma/array.rb +2 -0
  34. data/lib/comma/data_extractor.rb +5 -5
  35. data/lib/comma/data_mapper_collection.rb +9 -3
  36. data/lib/comma/extractor.rb +3 -5
  37. data/lib/comma/generator.rb +11 -11
  38. data/lib/comma/header_extractor.rb +18 -14
  39. data/lib/comma/mongoid.rb +10 -7
  40. data/lib/comma/object.rb +5 -1
  41. data/lib/comma/relation.rb +16 -10
  42. data/lib/comma/version.rb +3 -1
  43. data/spec/comma/comma_spec.rb +68 -47
  44. data/spec/comma/data_extractor_spec.rb +6 -10
  45. data/spec/comma/header_extractor_spec.rb +2 -8
  46. data/spec/comma/rails/active_record_spec.rb +28 -26
  47. data/spec/comma/rails/data_mapper_collection_spec.rb +4 -3
  48. data/spec/comma/rails/mongoid_spec.rb +8 -7
  49. data/spec/controllers/users_controller_spec.rb +48 -47
  50. data/spec/non_rails_app/ruby_classes.rb +13 -6
  51. data/spec/rails_app/active_record/config.rb +3 -1
  52. data/spec/rails_app/active_record/models.rb +4 -2
  53. data/spec/rails_app/data_mapper/config.rb +2 -0
  54. data/spec/rails_app/mongoid/config.rb +4 -2
  55. data/spec/rails_app/rails_app.rb +12 -11
  56. data/spec/rails_app/tmp/.gitkeep +0 -0
  57. data/spec/spec_helper.rb +7 -3
  58. metadata +27 -30
  59. data/gemfiles/active4.0.13.gemfile.lock +0 -107
  60. data/gemfiles/active4.1.16.gemfile.lock +0 -106
  61. data/gemfiles/active5.2.0.gemfile +0 -10
  62. data/gemfiles/rails4.0.13.gemfile.lock +0 -158
  63. data/gemfiles/rails4.1.16.gemfile.lock +0 -162
  64. data/gemfiles/rails5.0.1.gemfile +0 -11
  65. data/gemfiles/rails5.0.1.gemfile.lock +0 -194
  66. data/gemfiles/rails5.1.0.gemfile.lock +0 -194
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  # comma do
@@ -8,7 +10,6 @@ require 'spec_helper'
8
10
  # end
9
11
 
10
12
  describe Comma::HeaderExtractor do # rubocop:disable Metrics/BlockLength
11
-
12
13
  before do
13
14
  @isbn = Isbn.new('123123123', '321321321')
14
15
  @book = Book.new('Smalltalk-80', 'Language and Implementation', @isbn)
@@ -17,37 +18,30 @@ describe Comma::HeaderExtractor do # rubocop:disable Metrics/BlockLength
17
18
  end
18
19
 
19
20
  describe 'when no parameters are provided' do
20
-
21
21
  it 'should use the method name as the header name, humanized' do
22
22
  @headers.should include('Description')
23
23
  end
24
24
  end
25
25
 
26
26
  describe 'when given a string description as a parameter' do
27
-
28
27
  it 'should use the string value, unmodified' do
29
28
  @headers.should include('Title')
30
29
  end
31
30
  end
32
31
 
33
32
  describe 'when an hash is passed as a parameter' do
34
-
35
33
  describe 'with a string value' do
36
-
37
34
  it 'should use the string value, unmodified' do
38
35
  @headers.should include('ISBN-10')
39
36
  end
40
37
  end
41
38
 
42
39
  describe 'with a non-string value' do
43
-
44
40
  it 'should use the non string value converted to a string, humanized' do
45
41
  @headers.should include('Issuer')
46
42
  end
47
43
  end
48
-
49
44
  end
50
-
51
45
  end
52
46
 
53
47
  describe Comma::HeaderExtractor, 'with static column method' do
@@ -1,19 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  if defined? ActiveRecord
4
6
 
5
7
  describe Comma, 'generating CSV from an ActiveRecord object' do # rubocop:disable Metrics/BlockLength
6
-
7
8
  class Picture < ActiveRecord::Base
8
- belongs_to :imageable, :polymorphic => true
9
+ belongs_to :imageable, polymorphic: true
9
10
 
10
11
  comma :pr_83 do
11
- imageable :name => 'Picture'
12
+ imageable name: 'Picture'
12
13
  end
13
14
  end
14
15
 
15
16
  class Person < ActiveRecord::Base
16
- scope(:teenagers, lambda { where(:age => 13..19) })
17
+ scope(:teenagers, -> { where(age: 13..19) })
17
18
 
18
19
  comma do
19
20
  name
@@ -26,18 +27,18 @@ if defined? ActiveRecord
26
27
  job :title
27
28
  end
28
29
 
29
- has_many :pictures, :as => :imageable
30
+ has_many :pictures, as: :imageable
30
31
  end
31
32
 
32
33
  class Job < ActiveRecord::Base
33
34
  belongs_to :person
34
35
 
35
36
  comma do
36
- person_formatter :name => 'Name'
37
+ person_formatter name: 'Name'
37
38
  end
38
39
 
39
40
  def person_formatter
40
- @person_formatter ||= PersonFormatter.new(self.person)
41
+ @person_formatter ||= PersonFormatter.new(person)
41
42
  end
42
43
  end
43
44
 
@@ -52,33 +53,33 @@ if defined? ActiveRecord
52
53
  end
53
54
 
54
55
  before(:all) do
55
- #Setup AR model in memory
56
- ActiveRecord::Base.connection.create_table :pictures, :force => true do |table|
56
+ # Setup AR model in memory
57
+ ActiveRecord::Base.connection.create_table :pictures, force: true do |table|
57
58
  table.column :name, :string
58
59
  table.column :imageable_id, :integer
59
60
  table.column :imageable_type, :string
60
61
  end
61
62
 
62
- ActiveRecord::Base.connection.create_table :people, :force => true do |table|
63
+ ActiveRecord::Base.connection.create_table :people, force: true do |table|
63
64
  table.column :name, :string
64
65
  table.column :age, :integer
65
66
  end
66
67
  Person.reset_column_information
67
68
 
68
- ActiveRecord::Base.connection.create_table :jobs, :force => true do |table|
69
+ ActiveRecord::Base.connection.create_table :jobs, force: true do |table|
69
70
  table.column :person_id, :integer
70
71
  table.column :title, :string
71
72
  end
72
73
  Job.reset_column_information
73
74
 
74
- @person = Person.new(:age => 18, :name => 'Junior')
75
- @person.build_job(:title => 'Nice job')
75
+ @person = Person.new(age: 18, name: 'Junior')
76
+ @person.build_job(title: 'Nice job')
76
77
  @person.save!
77
- Picture.create(:name => 'photo.jpg', :imageable_id => @person.id, :imageable_type => 'Person')
78
+ Picture.create(name: 'photo.jpg', imageable_id: @person.id, imageable_type: 'Person')
78
79
  end
79
80
 
80
- describe "#to_comma on scopes" do
81
- it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do
81
+ describe '#to_comma on scopes' do
82
+ it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do # rubocop:disable Style/LineLength
82
83
  Person.teenagers.to_comma.should == "Name,Age\nJunior,18\n"
83
84
  end
84
85
 
@@ -112,7 +113,7 @@ if defined? ActiveRecord
112
113
  end
113
114
  end
114
115
 
115
- I18n.config.backend.store_translations(:ja, {:activerecord => {:attributes => {:person => {:age => '年齢', :name => '名前'}}}})
116
+ I18n.config.backend.store_translations(:ja, activerecord: { attributes: { person: { age: '年齢', name: '名前' } } })
116
117
  @original_locale = I18n.locale
117
118
  I18n.locale = :ja
118
119
  end
@@ -131,7 +132,7 @@ if defined? ActiveRecord
131
132
 
132
133
  describe 'github issue 75' do
133
134
  it 'should find association' do
134
- lambda { Person.all.to_comma(:issue_75) }.should_not raise_error
135
+ -> { Person.all.to_comma(:issue_75) }.should_not raise_error
135
136
  end
136
137
  end
137
138
 
@@ -143,12 +144,13 @@ if defined? ActiveRecord
143
144
 
144
145
  describe 'github pull-request 83' do
145
146
  it 'should not raise NameError' do
146
- lambda { Picture.all.to_comma(:pr_83) }.should_not raise_exception(NameError)
147
+ expect { Picture.all.to_comma(:pr_83) }
148
+ .not_to raise_exception(NameError)
147
149
  end
148
150
  end
149
151
  end
150
152
 
151
- describe Comma, 'generating CSV from an ActiveRecord object using Single Table Inheritance' do # rubocop:disable Metrics/BlockLength
153
+ describe Comma, 'generating CSV from an ActiveRecord object using Single Table Inheritance' do # rubocop:disable Metric/BlockLength
152
154
  class Animal < ActiveRecord::Base
153
155
  comma do
154
156
  name 'Name' do |name|
@@ -174,15 +176,15 @@ if defined? ActiveRecord
174
176
  end
175
177
 
176
178
  before(:all) do
177
- #Setup AR model in memory
178
- ActiveRecord::Base.connection.create_table :animals, :force => true do |table|
179
+ # Setup AR model in memory
180
+ ActiveRecord::Base.connection.create_table :animals, force: true do |table|
179
181
  table.column :name, :string
180
182
  table.column :type, :string
181
183
  end
182
184
 
183
- @dog = Dog.new(:name => 'Rex')
185
+ @dog = Dog.new(name: 'Rex')
184
186
  @dog.save!
185
- @cat = Cat.new(:name => 'Kitty')
187
+ @cat = Cat.new(name: 'Kitty')
186
188
  @cat.save!
187
189
  end
188
190
 
@@ -190,13 +192,13 @@ if defined? ActiveRecord
190
192
  @dog.to_comma.should == %w[Dog-Rex]
191
193
  end
192
194
 
193
- #FIXME: this one is failing - the comma block from Dog is executed instead of the one from the super class
195
+ # FIXME: this one is failing - the comma block from Dog is executed instead of the one from the super class
194
196
  it 'should return and array of data content, as defined in comma block in super class, if not present in child' do
195
197
  @cat.to_comma.should == %w[Super-Kitty]
196
198
  end
197
199
 
198
200
  it 'should call definion in parent class' do
199
- lambda { @dog.to_comma(:with_type) }.should_not raise_error
201
+ -> { @dog.to_comma(:with_type) }.should_not raise_error
200
202
  end
201
203
  end
202
204
  end
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  if defined? DataMapper
4
6
 
5
7
  describe Comma, 'generating CSV from an DataMapper object' do # rubocop:disable Metrics/BlockLength
6
-
7
8
  class Person
8
9
  include DataMapper::Resource
9
10
 
@@ -30,9 +31,9 @@ if defined? DataMapper
30
31
  after(:all) do
31
32
  end
32
33
 
33
- describe "case" do
34
+ describe 'case' do
34
35
  before do
35
- @person = Person.new(:age => 18, :name => 'Junior')
36
+ @person = Person.new(age: 18, name: 'Junior')
36
37
  @person.save
37
38
  end
38
39
 
@@ -1,16 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  if defined? Mongoid
4
6
 
5
7
  describe Comma, 'generating CSV from an Mongoid object' do
6
-
7
8
  class Person
8
9
  include Mongoid::Document
9
10
 
10
- field :name, :type => String
11
- field :age, :type => Integer
11
+ field :name, type: String
12
+ field :age, type: Integer
12
13
 
13
- scope :teenagers, between(:age => 13..19)
14
+ scope :teenagers, between(age: 13..19)
14
15
 
15
16
  comma do
16
17
  name
@@ -22,13 +23,13 @@ if defined? Mongoid
22
23
  Mongoid.purge!
23
24
  end
24
25
 
25
- describe "case" do
26
+ describe 'case' do
26
27
  before do
27
- @person = Person.new(:age => 18, :name => 'Junior')
28
+ @person = Person.new(age: 18, name: 'Junior')
28
29
  @person.save
29
30
  end
30
31
 
31
- it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do
32
+ it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do # rubocop:disable Metrics/LineLength
32
33
  Person.teenagers.to_comma.should == "Name,Age\nJunior,18\n"
33
34
  end
34
35
 
@@ -1,26 +1,25 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  if defined?(Rails)
4
6
 
5
7
  RSpec.describe UsersController, type: :controller do # rubocop:disable Metrics/BlockLength
6
-
7
- describe "rails setup" do
8
-
8
+ describe 'rails setup' do
9
9
  it 'should capture the CSV renderer provided by Rails' do
10
10
  mock_users = [mock_model(User), mock_model(User)]
11
11
  allow(User).to receive(:all).and_return(mock_users)
12
12
 
13
13
  mock_users.should_receive(:to_comma).once
14
14
 
15
- get :index, :format => :csv
15
+ get :index, format: :csv
16
16
  end
17
-
18
17
  end
19
18
 
20
- describe "controller" do # rubocop:disable Metrics/BlockLength
19
+ describe 'controller' do # rubocop:disable Metrics/BlockLength
21
20
  before(:all) do
22
- @user_1 = User.create!(:first_name => 'Fred', :last_name => 'Flintstone')
23
- @user_2 = User.create!(:first_name => 'Wilma', :last_name => 'Flintstone')
21
+ @user_1 = User.create!(first_name: 'Fred', last_name: 'Flintstone')
22
+ @user_2 = User.create!(first_name: 'Wilma', last_name: 'Flintstone')
24
23
  end
25
24
 
26
25
  it 'should not affect html requested' do
@@ -28,42 +27,40 @@ if defined?(Rails)
28
27
 
29
28
  response.status.should eq 200
30
29
  response.content_type.should eq 'text/html'
31
- response.body.should == 'Users!'
30
+ response.body.should == 'Users!'
32
31
  end
33
32
 
34
- it "should return a csv when requested" do
35
- get :index, :format => :csv
33
+ it 'should return a csv when requested' do
34
+ get :index, format: :csv
36
35
 
37
36
  response.status.should eq 200
38
37
  response.content_type.should eq 'text/csv'
39
- response.header["Content-Disposition"].should include('filename="data.csv"')
38
+ response.header['Content-Disposition'].should include('filename="data.csv"')
40
39
 
41
- expected_content =<<-CSV.gsub(/^\s+/,'')
40
+ expected_content = <<-CSV.gsub(/^\s+/, '')
42
41
  First name,Last name,Name
43
42
  Fred,Flintstone,Fred Flintstone
44
43
  Wilma,Flintstone,Wilma Flintstone
45
44
  CSV
46
45
 
47
- response.body.should == expected_content
46
+ response.body.should == expected_content
48
47
  end
49
48
 
50
49
  describe 'with comma options' do
51
-
52
50
  it 'should allow the style to be chosen from the renderer' do
53
- #Must be passed in same format (string/symbol) eg:
51
+ # Must be passed in same format (string/symbol) eg:
54
52
  # format.csv { render User.all, :style => :shortened }
55
53
 
56
- get :with_custom_style, :format => :csv
54
+ get :with_custom_style, format: :csv
57
55
 
58
- expected_content =<<-CSV.gsub(/^\s+/,'')
56
+ expected_content = <<-CSV.gsub(/^\s+/, '')
59
57
  First name,Last name
60
58
  Fred,Flintstone
61
59
  Wilma,Flintstone
62
60
  CSV
63
61
 
64
- response.body.should == expected_content
62
+ response.body.should == expected_content
65
63
  end
66
-
67
64
  end
68
65
 
69
66
  describe 'with custom options' do # rubocop:disable Metrics/BlockLength
@@ -80,105 +77,109 @@ if defined?(Rails)
80
77
  end
81
78
 
82
79
  it 'should allow a filename to be set' do
83
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :filename => 'my_custom_name' } }
80
+ get_ :with_custom_options, format: :csv, params: { custom_options: { filename: 'my_custom_name' } }
84
81
 
85
82
  response.status.should eq 200
86
83
  response.content_type.should eq 'text/csv'
87
- response.header["Content-Disposition"].should include('filename="my_custom_name.csv"')
84
+ response.header['Content-Disposition'].should include('filename="my_custom_name.csv"')
88
85
  end
89
86
 
90
- it "should allow a custom filename with spaces" do
87
+ it 'should allow a custom filename with spaces' do
91
88
  require 'shellwords'
92
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :filename => 'filename with a lot of spaces' } }
89
+ params = { custom_options: { filename: 'filename with a lot of spaces' } }
90
+ get_ :with_custom_options, format: :csv, params: params
93
91
 
94
92
  response.status.should eq 200
95
93
  response.content_type.should eq 'text/csv'
96
- response.header["Content-Disposition"].should include('filename="filename with a lot of spaces.csv"')
94
+ response.header['Content-Disposition'].should include('filename="filename with a lot of spaces.csv"')
97
95
 
98
- filename_string = response.header["Content-Disposition"].split('=').last
96
+ filename_string = response.header['Content-Disposition'].split('=').last
99
97
  # shellsplit honors quoted strings
100
98
  filename_string.shellsplit.length.should == 1
101
99
  end
102
100
 
103
101
  it 'should allow a file extension to be set' do
104
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :extension => :txt } }
102
+ get_ :with_custom_options, format: :csv, params: { custom_options: { extension: :txt } }
105
103
 
106
104
  response.status.should eq 200
107
105
  response.content_type.should eq 'text/csv'
108
- response.header["Content-Disposition"].should include('filename="data.txt"')
106
+ response.header['Content-Disposition'].should include('filename="data.txt"')
109
107
  end
110
108
 
111
109
  it 'should allow mime type to be set' do
112
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :mime_type => 'text/plain' } }
110
+ get_ :with_custom_options, format: :csv, params: { custom_options: { mime_type: 'text/plain' } }
113
111
  response.status.should eq 200
114
- response.content_type.should == 'text/plain'
112
+ response.content_type.should == 'text/plain'
115
113
  end
116
114
 
117
115
  describe 'headers' do
118
-
119
116
  it 'should allow toggling on' do
120
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :write_headers => 'true' } }
117
+ get_ :with_custom_options, format: :csv, params: { custom_options: { write_headers: 'true' } }
121
118
 
122
119
  response.status.should eq 200
123
120
  response.content_type.should eq 'text/csv'
124
121
 
125
- expected_content =<<-CSV.gsub(/^\s+/,'')
122
+ expected_content = <<-CSV.gsub(/^\s+/, '')
126
123
  First name,Last name,Name
127
124
  Fred,Flintstone,Fred Flintstone
128
125
  Wilma,Flintstone,Wilma Flintstone
129
126
  CSV
130
127
 
131
- response.body.should == expected_content
128
+ response.body.should == expected_content
132
129
  end
133
130
 
134
131
  it 'should allow toggling off' do
135
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => {:write_headers => false} }
132
+ get_ :with_custom_options, format: :csv, params: { custom_options: { write_headers: false } }
136
133
 
137
134
  response.status.should eq 200
138
135
  response.content_type.should eq 'text/csv'
139
136
 
140
- expected_content =<<-CSV.gsub(/^\s+/,'')
137
+ expected_content = <<-CSV.gsub(/^\s+/, '')
141
138
  Fred,Flintstone,Fred Flintstone
142
139
  Wilma,Flintstone,Wilma Flintstone
143
140
  CSV
144
141
 
145
- response.body.should == expected_content
142
+ response.body.should == expected_content
146
143
  end
147
-
148
144
  end
149
145
 
150
146
  it 'should allow forcing of quotes' do
151
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :force_quotes => true } }
147
+ get_ :with_custom_options, format: :csv, params: { custom_options: { force_quotes: true } }
152
148
 
153
149
  response.status.should eq 200
154
150
  response.content_type.should eq 'text/csv'
155
151
 
156
- expected_content =<<-CSV.gsub(/^\s+/,'')
152
+ expected_content = <<-CSV.gsub(/^\s+/, '')
157
153
  "First name","Last name","Name"
158
154
  "Fred","Flintstone","Fred Flintstone"
159
155
  "Wilma","Flintstone","Wilma Flintstone"
160
156
  CSV
161
157
 
162
- response.body.should == expected_content
158
+ response.body.should == expected_content
163
159
  end
164
160
 
165
161
  it 'should allow combinations of options' do
166
- get_ :with_custom_options, :format => :csv, :params => { :custom_options => { :write_headers => false, :force_quotes => true, :col_sep => '||', :row_sep => "ENDOFLINE\n" } }
162
+ params = {
163
+ custom_options: {
164
+ write_headers: false,
165
+ force_quotes: true,
166
+ col_sep: '||',
167
+ row_sep: "ENDOFLINE\n"
168
+ }
169
+ }
170
+ get_ :with_custom_options, format: :csv, params: params
167
171
 
168
172
  response.status.should eq 200
169
173
  response.content_type.should eq 'text/csv'
170
174
 
171
- expected_content =<<-CSV.gsub(/^\s+/,'')
175
+ expected_content = <<-CSV.gsub(/^\s+/, '')
172
176
  "Fred"||"Flintstone"||"Fred Flintstone"ENDOFLINE
173
177
  "Wilma"||"Flintstone"||"Wilma Flintstone"ENDOFLINE
174
178
  CSV
175
179
 
176
- response.body.should == expected_content
180
+ response.body.should == expected_content
177
181
  end
178
-
179
182
  end
180
-
181
183
  end
182
-
183
184
  end
184
185
  end