Make testing suite running and pass in Windows

thanks @bf4 give many help and suggestion, original PR https://github.com/rails-api/active_model_serializers/pull/1014
This commit is contained in:
Eric Guo 2015-08-19 13:30:56 +08:00
parent 90bff2f15b
commit 30463f88fa
2 changed files with 8 additions and 1 deletions

View File

@ -15,3 +15,6 @@ if version == "master"
else
gem "rails", "~> #{version}.0"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

View File

@ -46,7 +46,11 @@ class SerializerGeneratorTest < Rails::Generators::TestCase
def test_with_no_attributes_does_not_add_extra_space
run_generator ["account"]
assert_file "app/serializers/account_serializer.rb" do |content|
assert_no_match /\n\nend/, content
if RUBY_PLATFORM =~ /mingw/
assert_no_match /\r\n\r\nend/, content
else
assert_no_match /\n\nend/, content
end
end
end
end