aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/alaveteli_text_masker_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/lib/alaveteli_text_masker_spec.rb b/spec/lib/alaveteli_text_masker_spec.rb
index f2d52c1cc..f8c22a849 100644
--- a/spec/lib/alaveteli_text_masker_spec.rb
+++ b/spec/lib/alaveteli_text_masker_spec.rb
@@ -31,10 +31,13 @@ describe AlaveteliTextMasker do
data.should == "There was a xxxxx called xxxxxxx, he wished that he was xxxx."
end
- it 'should handle multibyte characters correctly' do
+ it 'should handle multibyte characters in binary file types as binary data' do
data = 'á mouse'
+ if String.method_defined?(:encode)
+ data = data.force_encoding("ASCII-8BIT")
+ end
@regex_censor_rule.text = 'á'
- apply_masks!(data, "application/octet-stream", :censor_rules => @censor_rules).should == 'x mouse'
+ apply_masks!(data, "application/octet-stream", :censor_rules => @censor_rules).should == 'xx mouse'
end
it "should apply censor rules to HTML files" do