We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04d7560 commit f744777Copy full SHA for f744777
spec/actions/inject_into_file_spec.rb
@@ -105,8 +105,15 @@ def file
105
end
106
107
it "can insert chinese" do
108
- invoke! "doc/README.zh", "\n中文", :after => "__start__"
109
- expect(File.read(File.join(destination_root, "doc/README.zh"))).to eq("__start__\n中文\n说明\n__end__\n")
+ encoding_original = Encoding.default_external
+
110
+ begin
111
+ Encoding.default_external = Encoding.find("UTF-8")
112
+ invoke! "doc/README.zh", "\n中文", :after => "__start__"
113
+ expect(File.read(File.join(destination_root, "doc/README.zh"))).to eq("__start__\n中文\n说明\n__end__\n")
114
+ ensure
115
+ Encoding.default_external = encoding_original
116
+ end
117
118
119
0 commit comments