Skip to content

Commit

Permalink
Taking care of ruby 1.8 where everything is binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jarl-dk committed May 16, 2013
1 parent 2c2d552 commit 9893e67
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/aruba/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,27 @@ def all_output
end

def assert_exact_output(expected, actual)
actual.force_encoding(expected.encoding)
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
unescape(actual).should == unescape(expected)
end

def assert_partial_output(expected, actual)
actual.force_encoding(expected.encoding)
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
unescape(actual).should include(unescape(expected))
end

def assert_matching_output(expected, actual)
actual.force_encoding(expected.encoding)
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
unescape(actual).should =~ /#{unescape(expected)}/m
end

def assert_not_matching_output(expected, actual)
actual.force_encoding(expected.encoding)
actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
unescape(actual).should_not =~ /#{unescape(expected)}/m
end

def assert_no_partial_output(unexpected, actual)
actual.force_encoding(unexpected.encoding)
actual.force_encoding(unexpected.encoding) if RUBY_VERSION >= "1.9"
if Regexp === unexpected
unescape(actual).should_not =~ unexpected
else
Expand Down

0 comments on commit 9893e67

Please sign in to comment.