Skip to content

Commit

Permalink
Update supported Rails and Ruby versions
Browse files Browse the repository at this point in the history
Includes removing Timecop, since Rails now has what we need.
  • Loading branch information
lcreid committed Apr 29, 2020
1 parent 0dacf8c commit baa0cdf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require: rubocop-rails
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.3
TargetRubyVersion: 2.5
Exclude:
- "bin/*"
- Capfile
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ group :test do
gem "equivalent-xml"
gem "mocha"
gem "sqlite3"
gem "timecop", "~> 0.7.1"
end
6 changes: 3 additions & 3 deletions bootstrap_form.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Gem::Specification.new do |s|
s.bindir = "exe"
s.require_paths = ["lib"]

s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.add_dependency("actionpack", ">= 5.0")
s.add_dependency("activemodel", ">= 5.0")
s.add_dependency("actionpack", ">= 5.2")
s.add_dependency("activemodel", ">= 5.2")
end
28 changes: 14 additions & 14 deletions test/bootstrap_selects_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "date selects are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3)) do
travel_to(Time.utc(2012, 2, 3)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand All @@ -316,7 +316,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "date selects are wrapped correctly with wrapper class" do
Timecop.freeze(Time.utc(2012, 2, 3)) do
travel_to(Time.utc(2012, 2, 3)) do
expected = <<-HTML.strip_heredoc
<div class="form-group none-margin">
<label for="user_misc">Misc</label>
Expand All @@ -338,7 +338,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "date selects inline when layout is horizontal" do
Timecop.freeze(Time.utc(2012, 2, 3)) do
travel_to(Time.utc(2012, 2, 3)) do
expected = <<-HTML.strip_heredoc
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post" role="form">
#{'<input name="utf8" type="hidden" value="&#x2713;"/>' unless ::Rails::VERSION::STRING >= '6'}
Expand Down Expand Up @@ -366,7 +366,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)

test "date selects are wrapped correctly with error" do
@user.errors.add(:misc, "error for test")
Timecop.freeze(Time.utc(2012, 2, 3)) do
travel_to(Time.utc(2012, 2, 3)) do
expected = <<-HTML.strip_heredoc
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post" role="form">
#{'<input name="utf8" type="hidden" value="&#x2713;"/>' unless ::Rails::VERSION::STRING >= '6'}
Expand All @@ -392,7 +392,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "date selects with options are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3)) do
travel_to(Time.utc(2012, 2, 3)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand All @@ -418,7 +418,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "date selects with options and html_options are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3)) do
travel_to(Time.utc(2012, 2, 3)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand All @@ -443,7 +443,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "time selects are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand All @@ -467,7 +467,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)

test "time selects are wrapped correctly with error" do
@user.errors.add(:misc, "error for test")
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post" role="form">
#{'<input name="utf8" type="hidden" value="&#x2713;"/>' unless ::Rails::VERSION::STRING >= '6'}
Expand All @@ -494,7 +494,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "time selects with options are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand All @@ -519,7 +519,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "time selects with options and html_options are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand All @@ -544,7 +544,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "datetime selects are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand Down Expand Up @@ -575,7 +575,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)

test "datetime selects are wrapped correctly with error" do
@user.errors.add(:misc, "error for test")
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post" role="form">
#{'<input name="utf8" type="hidden" value="&#x2713;"/>' unless ::Rails::VERSION::STRING >= '6'}
Expand Down Expand Up @@ -609,7 +609,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "datetime selects with options are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand Down Expand Up @@ -644,7 +644,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false)
end

test "datetime selects with options and html_options are wrapped correctly" do
Timecop.freeze(Time.utc(2012, 2, 3, 12, 0, 0)) do
travel_to(Time.utc(2012, 2, 3, 12, 0, 0)) do
expected = <<-HTML.strip_heredoc
<div class="form-group">
<label for="user_misc">Misc</label>
Expand Down
1 change: 0 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ENV["RAILS_ENV"] ||= "test"

require "timecop"
require "diffy"
require "nokogiri"
require "equivalent-xml"
Expand Down

0 comments on commit baa0cdf

Please sign in to comment.