Skip to content

Commit 30463f8

Browse files
committed
Make testing suite running and pass in Windows
thanks @bf4 give many help and suggestion, original PR #1014
1 parent 90bff2f commit 30463f8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ if version == "master"
1515
else
1616
gem "rails", "~> #{version}.0"
1717
end
18+
19+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
20+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

test/generators/serializer_generator_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ def test_generates_attributes_and_associations
4646
def test_with_no_attributes_does_not_add_extra_space
4747
run_generator ["account"]
4848
assert_file "app/serializers/account_serializer.rb" do |content|
49-
assert_no_match /\n\nend/, content
49+
if RUBY_PLATFORM =~ /mingw/
50+
assert_no_match /\r\n\r\nend/, content
51+
else
52+
assert_no_match /\n\nend/, content
53+
end
5054
end
5155
end
5256
end

0 commit comments

Comments
 (0)