minitest-assert-json-equal 0.2.0 → 0.2.1

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: 393b83b356e5053e6e3e94664d2ca1abb39976bc
4
- data.tar.gz: 924c5eb0f2c045904bd334e5079fe2998e119860
3
+ metadata.gz: 51506e03e055f1ee01f1119204b8e5803f2efb44
4
+ data.tar.gz: 5bb2016d2f84ec47b007b6e179ff7016486b753d
5
5
  SHA512:
6
- metadata.gz: 496b02d8a001fb97ce75367cc701d30b5711e4d1f43954086915116310d5f23ee15a4ba7504ccb01deaecc0b41fc03440262f61f6cc455ab5b4464972a1b6e82
7
- data.tar.gz: 957b59b8fe3a66b492de9e267791c347f5cba0db6357882a495dead3cf7e09806f9a49447994958b3ec65a5d5e9f1c997a97a5e960b639a4663f2c2e0fc1eddb
6
+ metadata.gz: ede4781f279f9faf4de97a80a46c38e7a22f9537f585ecc0ded1ab251fa33389cc26a77c748e5f814c449e96bba1b0009210c05f39ab0c30a574dbaa0c58a110
7
+ data.tar.gz: b47c90c27b72c2c1b7ea59e547e16e3e0db92183a0a2267fda16b317b81a3b400a80e56e86bd83e537fae5e04a350bb420833dfa2795869d77563d2e4386f111
@@ -8,3 +8,4 @@ rvm:
8
8
  - 2.3.1
9
9
  - jruby
10
10
  - rbx-2
11
+ before_install: gem install bundler -v 1.12.5
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # minitest-assert-json-equal
2
2
 
3
+ [![Build Status](https://travis-ci.org/icco/minitest-assert-json-equal.svg?branch=master)](https://travis-ci.org/icco/minitest-assert-json-equal)
4
+
3
5
  This adds two methods to your minitest: `assert_json_equal` and `refute_json_equal`. They don't care about the json string. They just make sure two things are true:
4
6
 
5
7
  - the json parses.
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
7
  t.test_files = FileList['test/*_test.rb', 'test/**/*_test.rb']
8
8
  end
9
9
 
10
- task :default => :test
10
+ task default: :test
@@ -1,40 +1,40 @@
1
- require "minitest-assert-json-equal/version"
2
- require "minitest"
3
- require "json"
1
+ require 'minitest-assert-json-equal/version'
2
+ require 'minitest'
3
+ require 'json'
4
4
 
5
5
  module MinitestAssertJsonEqual
6
6
  end
7
7
 
8
8
  module Minitest::Assertions
9
- def assert_json_equal(json_a, json_b, msg=nil)
9
+ def assert_json_equal(json_a, json_b, msg = nil)
10
10
  a = JSON.parse(json_a)
11
11
  b = JSON.parse(json_b)
12
12
 
13
- msg = message(msg, "") {
14
- "Expected json to match."
15
- }
13
+ msg = message(msg, '') do
14
+ 'Expected json to match.'
15
+ end
16
16
 
17
17
  assert_equal a, b, msg
18
18
  rescue JSON::ParserError
19
- msg = message(msg, "") {
20
- "JSON does not parse."
21
- }
19
+ msg = message(msg, '') do
20
+ 'JSON does not parse.'
21
+ end
22
22
  flunk msg
23
23
  end
24
24
 
25
- def refute_json_equal(json_a, json_b, msg=nil)
25
+ def refute_json_equal(json_a, json_b, msg = nil)
26
26
  a = JSON.parse(json_a)
27
27
  b = JSON.parse(json_b)
28
28
 
29
- msg = message(msg, "") {
30
- "Expected json to match."
31
- }
29
+ msg = message(msg, '') do
30
+ 'Expected json to match.'
31
+ end
32
32
 
33
33
  refute_equal a, b, msg
34
34
  rescue JSON::ParserError
35
- msg = message(msg, "") {
36
- "JSON does not parse."
37
- }
35
+ msg = message(msg, '') do
36
+ 'JSON does not parse.'
37
+ end
38
38
  flunk msg
39
39
  end
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module MinitestAssertJsonEqual
2
- VERSION = "0.2.0"
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -4,28 +4,28 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'minitest-assert-json-equal/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "minitest-assert-json-equal"
7
+ spec.name = 'minitest-assert-json-equal'
8
8
  spec.version = MinitestAssertJsonEqual::VERSION
9
- spec.authors = ["Nat Welch"]
10
- spec.email = ["nat@natwelch.com"]
9
+ spec.authors = ['Nat Welch']
10
+ spec.email = ['nat@natwelch.com']
11
11
 
12
- spec.summary = %q{A gem to compare json strings to see if they are similar.}
13
- spec.homepage = "https://github.com/icco/minitest-assert-json-equal"
14
- spec.license = "MIT"
12
+ spec.summary = 'A gem to compare json strings to see if they are similar.'
13
+ spec.homepage = 'https://github.com/icco/minitest-assert-json-equal'
14
+ spec.license = 'MIT'
15
15
 
16
16
  if spec.respond_to?(:metadata)
17
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
18
  else
19
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
19
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
20
20
  end
21
21
 
22
22
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
- spec.bindir = "exe"
23
+ spec.bindir = 'exe'
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
- spec.require_paths = ["lib"]
25
+ spec.require_paths = ['lib']
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.12"
28
- spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency 'bundler', '~> 1.12'
28
+ spec.add_development_dependency 'rake', '~> 10.0'
29
29
 
30
- spec.add_dependency "minitest", "~> 5.0"
30
+ spec.add_dependency 'minitest', '~> 5.0'
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-assert-json-equal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch