Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding scope specs

  • Loading branch information...
commit 4640b47875135a5166f22fb5ce4e35e3c5f8eea2 1 parent f4bd5fa
Christopher Burnett authored

Showing 2 changed files with 32 additions and 2 deletions. Show diff stats Hide diff stats

  1. +28 2 spec/lib/pathy_spec.rb
  2. +4 0 spec/spec_helper.rb
30 spec/lib/pathy_spec.rb
... ... @@ -1,9 +1,33 @@
1 1 require 'spec_helper'
2 2
3 3 describe Pathy do
4   - before :all do
5 4
6   - Object.pathy!
  5 + describe "pathy scope" do
  6 +
  7 + describe "Object.new" do
  8 + it "should not respond to :has_json_path?" do
  9 + Object.new.should_not respond_to(:has_json_path?)
  10 + end
  11 + end
  12 +
  13 + describe "SampleClass" do
  14 + before :all do
  15 + SampleClass.pathy!
  16 + end
  17 +
  18 + it "should not respond to :has_json_path?" do
  19 + Object.new.should_not respond_to(:has_json_path?)
  20 + end
  21 +
  22 + it "should respond to :has_json_path?" do
  23 + SampleClass.new.should respond_to(:has_json_path?)
  24 + end
  25 +
  26 + end
  27 +
  28 + end
  29 +
  30 + before :all do
7 31
8 32 @json = %[
9 33 {
@@ -29,6 +53,8 @@
29 53
30 54 describe "for hashes" do
31 55 before :all do
  56 + Object.pathy!
  57 +
32 58 @obj = JSON.parse(@json)
33 59 @array = JSON.parse(@json_array)
34 60 end
4 spec/spec_helper.rb
@@ -2,3 +2,7 @@
2 2 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3 3 require 'pathy'
4 4 require 'json'
  5 +
  6 +class SampleClass
  7 +
  8 +end

0 comments on commit 4640b47

Please sign in to comment.
Something went wrong with that request. Please try again.