Add support for MiniTest #36

Open
wants to merge 2 commits into
from

Projects

None yet

9 participants

@blowmage

Allow json_spec to be used from minitest tests.

blowmage added some commits Oct 26, 2012
@blowmage blowmage Remove RSpec as a dependecy
So that users can decide whether to use json_spec with RSpec or MiniTest.
bdec9a1
@blowmage blowmage Add support for MiniTest 5da9e62
@laserlemon
Member

Awesome, thank you! 👏 I don't personally use MiniTest but I'm going to try to pull somebody in who does to review this before I pull.

@phlipper

@blowmage this is a very nice addition, thank you! 👍 from me.

@gaffneyc
Member

@laserlemon: @jasonroelofs keeps talking about how we should use MiniTest more, he might be a good candidate

@laserlemon
Member

By all means @jasonroelofs, please chime in!

@jasonroelofs
Member

Well you guys know me, I love MiniTest and anything that helps people use MiniTest more is 👍 from me!

@laserlemon
Member

@jasonroelofs If you get a second, could you take a look at the commits/changes and let us know how it looks from another MiniTest user's perspective?

@laserlemon
Member

@blowmage I swear I don't distrust you as much as it sounds in this thread!

@jasonroelofs
Member

Nothing jumps out at me with this commit. As it is trying to keep the syntax of json_spec the same while allowing the use of MiniTest or Rspec under the hood I'd say it's done a good job of that.

@rdamborsky

+1

@johnsinco

Hi is this pulled? We'd like to make use of your gem in our minitest specs. Thx!!

@charlierudolph charlierudolph commented on the diff Dec 3, 2013
lib/json_spec/matchers.rb
end
end
-RSpec.configure do |config|
- config.include JsonSpec::Matchers
+if defined?(RSpec)
+ RSpec.configure do |config|
+ config.include JsonSpec::Matchers
+ end
@charlierudolph
charlierudolph Dec 3, 2013

If we are expanding these matchers to work elsewhere I'd rather have all configuration taken care either in its own file or required by the user in the test helper.

For rspec we could require the user to simply add this configuration to their spec_helper.
For minitest is there any better way to handle registering methods, so we could take them out of this file?
Are the classic assertions still highly used of could we get by without supporting them?

@charlierudolph charlierudolph commented on the diff Dec 3, 2013
spec/spec_helper.rb
@@ -1,3 +1,4 @@
+require "rspec"
@charlierudolph
charlierudolph Dec 3, 2013

rspec is not required for the spec_helper

@charlierudolph charlierudolph commented on the diff Dec 3, 2013
features/support/env.rb
@@ -1,5 +1,6 @@
$: << File.expand_path("../../../lib", __FILE__)
+require "rspec"
@charlierudolph
charlierudolph Dec 3, 2013

I believe this can be removed as well

@benwoodward

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment