masamune 0.17.14 → 0.17.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12cda9508ecb50bf13f5750d645fe67718e51264
4
- data.tar.gz: 8d285ef8dfc9370d650852f8063d1925aed943f4
3
+ metadata.gz: 0ecd8682fd1fc01a49affd8d28d3e299c601c75c
4
+ data.tar.gz: 45f3801d782a6cb2d2dc07e3a72a2f3286925bdc
5
5
  SHA512:
6
- metadata.gz: 23a73a59ba63fac580fe66238d760b5097c662d412f06474f2c3916244639e9a8a9dbadf124d7e45b38aa115763151b32fcff73e65fdb9dee446a323d09a57fd
7
- data.tar.gz: 34dd1c01933b0a7809fb3101007dcf56d729d197039a77e6275cc67d8e51b3286913826b06ed3cc1087ee0a3b15f3286fa3101f0aebbfa876151b10df3138905
6
+ metadata.gz: 4f8ee35378be875d5e37154757a471d09f5364375a9330b105744ed2093ec4e1280b0ae1dfe0118b1b656bb18fc797353b438532aa57d97718420b8c72ee1406
7
+ data.tar.gz: ec1c92befce218f594d0688f4e801f80554f8470895b8dc616e6d4013b93d52cdc6b3005caec0d6ccc9173447cd43cfea12756c74d1ad4e3c16f50e55ef94cb9
data/lib/masamune.rb CHANGED
@@ -20,6 +20,8 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  # THE SOFTWARE.
22
22
 
23
+ require 'tempfile'
24
+ require 'tmpdir'
23
25
  require 'active_support/concern'
24
26
 
25
27
  module Masamune
@@ -21,7 +21,6 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  require 'thread'
24
- require 'tmpdir'
25
24
  require 'logger'
26
25
 
27
26
  require 'masamune/version'
@@ -287,7 +287,7 @@ module Masamune::Schema
287
287
  when Hash
288
288
  value
289
289
  when String
290
- JSON.load(value)
290
+ JSON.parse(value)
291
291
  when nil
292
292
  {}
293
293
  end
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Masamune
24
- VERSION = '0.17.14'.freeze
24
+ VERSION = '0.17.15'.freeze
25
25
  end
@@ -471,13 +471,23 @@ describe Masamune::Schema::Column do
471
471
 
472
472
  context 'when scalar' do
473
473
  let(:value) { '1' }
474
- it { is_expected.to eq(1) }
474
+ it { expect { result }.to raise_error ArgumentError, "Could not coerce '1' into :json for column 'json'" }
475
475
  end
476
476
 
477
477
  context 'when array' do
478
+ let(:value) { '["1","2","3"]' }
479
+ it { is_expected.to eq(%w(1 2 3)) }
480
+ end
481
+
482
+ context 'when hash' do
478
483
  let(:value) { '{"k":"v"}' }
479
484
  it { is_expected.to eq('k' => 'v') }
480
485
  end
486
+
487
+ context 'when hash with UTF-8' do
488
+ let(:value) { '{"k":"£340.3m"}' }
489
+ it { is_expected.to eq('k' => '£340.3m') }
490
+ end
481
491
  end
482
492
  end
483
493
 
data/spec/spec_helper.rb CHANGED
@@ -23,9 +23,6 @@
23
23
  require 'bundler/setup'
24
24
  Bundler.require(:default, :development, :test)
25
25
 
26
- require 'tempfile'
27
- require 'tmpdir'
28
-
29
26
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
30
27
 
31
28
  require 'active_support/core_ext/string/strip'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: masamune
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.14
4
+ version: 0.17.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Andrews
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor