This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from banjun/id/156
fix ASIPhoneNotifier.strip parse error at double-quote refs #156
- Loading branch information
Showing
2 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- encoding: utf-8 -*- | ||
require File.dirname(__FILE__) + '/../../../../spec/spec_helper' | ||
require 'as_iphone_notifier' | ||
|
||
describe AsakusaSatellite::Hook::ASIPhoneNotifier do | ||
before do | ||
@hook = AsakusaSatellite::Hook::ASIPhoneNotifier.new({}) | ||
end | ||
|
||
it 'JSONエンコード済み文字列長制限で元の文字列を切る' do | ||
@hook.strip('test', 3).should == 'tes' | ||
@hook.strip('test', 4).should == 'test' | ||
@hook.strip('test', 5).should == 'test' | ||
|
||
@hook.strip('日本語', 3*6-1).should == '日本' | ||
@hook.strip('日本語', 3*6).should == '日本語' | ||
@hook.strip('日本語', 3*6+1).should == '日本語' | ||
end | ||
end | ||
|