Skip to content

Commit

Permalink
Add unit test that covers the -Infinity on the Range#end
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoamc committed May 6, 2016
1 parent 160f001 commit f93ce3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions spec/models/kalibro_range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@
expect(subject.as_json['end']).to eq('INF')
end
end

context 'with negative infinity end' do
before do
subject.end = -Float::INFINITY
end

it 'is expected to convert to INF' do
expect(subject.as_json['end']).to eq('-INF')
end
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Minimum coverage is only desired on CI tools when building the environment. CI is a
# default environment variable used by Travis. For reference, see here:
# https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
minimum_coverage 100 if ENV["CI"] == 'true'
minimum_coverage 100 if ENV['CI'] == 'true'
coverage_dir 'coverage/rspec'

add_filter '/spec/'
Expand Down

0 comments on commit f93ce3b

Please sign in to comment.