Skip to content

Commit 5a425d8

Browse files
committed
Fix: Rails 3 default format is different, now that we properly require rails.
1 parent ffe2465 commit 5a425d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/grape/api_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,9 @@ def self.io
13171317
it 'defaults to a standard logger log format' do
13181318
t = Time.at(100)
13191319
allow(Time).to receive(:now).and_return(t)
1320-
expect(subject.io).to receive(:write).with("I, [#{Logger::Formatter.new.send(:format_datetime, t)}\##{Process.pid}] INFO -- : this will be logged\n")
1320+
message = "this will be logged\n"
1321+
message = "I, [#{Logger::Formatter.new.send(:format_datetime, t)}\##{Process.pid}] INFO -- : #{message}" if !defined?(Rails) || Gem::Version.new(Rails::VERSION::STRING) >= Gem::Version.new('4.0')
1322+
expect(subject.io).to receive(:write).with(message)
13211323
subject.logger.info 'this will be logged'
13221324
end
13231325
end

0 commit comments

Comments
 (0)