1 # -*- encoding: utf-8 -*-
9 describe '例外なしパースに於いて' do
10 context 'テキストを渡されたとき' do
12 JSON.should_receive(:parse).with(any_args).exactly(1)
13 r = JSON.parse_no_except '{}'
15 it '単数データならHashで返す' do
16 r = JSON.parse_no_except '{}'
17 r.is_a?(Hash).should be_true
20 context 'パース失敗したとき' do
22 JSON.should_receive(:parse).with(any_args).and_raise('StandardError')
23 r = JSON.parse_no_except ''