More simply, you could do:
@my_string.encoding.should eq (Encoding.find("UTF-8"))