--- /dev/null
+# -*- encoding: utf-8 -*-
+#共通処理
+require 'common'
+
+describe JSON do
+ before do
+ end
+
+ describe '例外なしパースに於いて' do
+ context 'テキストを渡されたとき' do
+ it 'Json解析している' do
+ JSON.should_receive(:parse).with(any_args).exactly(1)
+ r = JSON.parse_no_except '{}'
+ end
+ it '単数データならHashで返す' do
+ r = JSON.parse_no_except '{}'
+ r.is_a?(Hash).should be_true
+ end
+ end
+ context 'パース失敗したとき' do
+ it 'Falseを返す' do
+ JSON.should_receive(:parse).with(any_args).and_raise('StandardError')
+ r = JSON.parse_no_except ''
+ r.should be_false
+ end
+ end
+ end
+end
+