diff options
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/alaveteli_external_command_spec.rb (renamed from spec/lib/alaveteli_external_command.rb) | 0 | ||||
-rw-r--r-- | spec/lib/basic_encoding_spec.rb (renamed from spec/lib/basic_encoding_tests.rb) | 20 | ||||
-rw-r--r-- | spec/lib/confidence_intervals_spec.rb (renamed from spec/lib/confidence_intervals.rb) | 0 | ||||
-rw-r--r-- | spec/lib/i18n_interpolation_spec.rb (renamed from spec/lib/i18n_interpolation.rb) | 1 |
4 files changed, 11 insertions, 10 deletions
diff --git a/spec/lib/alaveteli_external_command.rb b/spec/lib/alaveteli_external_command_spec.rb index 18afeda33..18afeda33 100644 --- a/spec/lib/alaveteli_external_command.rb +++ b/spec/lib/alaveteli_external_command_spec.rb diff --git a/spec/lib/basic_encoding_tests.rb b/spec/lib/basic_encoding_spec.rb index 35d35fd4a..43a65eab9 100644 --- a/spec/lib/basic_encoding_tests.rb +++ b/spec/lib/basic_encoding_spec.rb @@ -4,8 +4,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') def bytes_to_binary_string( bytes, claimed_encoding = nil ) claimed_encoding ||= 'ASCII-8BIT' bytes_string = bytes.pack('c*') - if RUBY_VERSION.to_f >= 1.9 - bytes_string.force_encoding! claimed_encoding + if String.method_defined?(:force_encoding) + bytes_string.force_encoding claimed_encoding end bytes_string end @@ -110,15 +110,15 @@ describe "convert_string_to_utf8_or_binary" do converted = convert_string_to_utf8_or_binary random_string converted.should == random_string - if RUBY_VERSION.to_f >= 1.9 - converted.encoding.should == 'ASCII-8BIT' + if String.method_defined?(:encode) + converted.encoding.to_s.should == 'ASCII-8BIT' end converted = convert_string_to_utf8_or_binary random_string,'UTF-8' converted.should == random_string - if RUBY_VERSION.to_f >= 1.9 - converted.encoding.should == 'ASCII-8BIT' + if String.method_defined?(:encode) + converted.encoding.to_s.should == 'ASCII-8BIT' end end @@ -132,8 +132,8 @@ describe "convert_string_to_utf8_or_binary" do converted.should == "DASH – DASH" - if RUBY_VERSION.to_f >= 1.9 - converted.encoding.should == 'UTF-8' + if String.method_defined?(:encode) + converted.encoding.to_s.should == 'UTF-8' end end @@ -147,8 +147,8 @@ describe "convert_string_to_utf8_or_binary" do converted.should start_with("贵公司负责人") - if RUBY_VERSION.to_f >= 1.9 - converted.encoding.should == 'UTF-8' + if String.method_defined?(:encode) + converted.encoding.to_s.should == 'UTF-8' end end diff --git a/spec/lib/confidence_intervals.rb b/spec/lib/confidence_intervals_spec.rb index cb8717f3d..cb8717f3d 100644 --- a/spec/lib/confidence_intervals.rb +++ b/spec/lib/confidence_intervals_spec.rb diff --git a/spec/lib/i18n_interpolation.rb b/spec/lib/i18n_interpolation_spec.rb index b07cf1e9a..47037ecdb 100644 --- a/spec/lib/i18n_interpolation.rb +++ b/spec/lib/i18n_interpolation_spec.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe "when using i18n" do |