# encoding: UTF-8 require 'spec_helper' shared_examples_for "convertable zenkaku" do |body| it 'should be converted' do @response.stub!(:body).and_return(body) @response.should_receive(:body=).with(/メインガギ漢字ひらがな。/) @filter.filter end end shared_examples_for "unconvertable zenkaku" do |body| it 'should not be converted' do @response.stub!(:body).and_return(body) @response.should_receive(:body=).with(/メインガギ漢字ひらがな。/) @filter.filter end end describe Galakei::Filter::Hankaku do before do @filter = described_class.new @filter.controller = mock("controller") @request = mock("request") @response = mock("response") @filter.controller.stub!(:request).and_return(@request) @filter.controller.stub!(:response).and_return(@response) end it_should_behave_like "convertable zenkaku", "