Sha256: f0e7aa7e6a2ec485edfa8b5549309b0a61cf6a80e3ef343fcd58abb09ec33f3d

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "ResponseBodyChecker" do
  describe "relative_path" do
    it 'should substitute an absolute addressing in a given path' do
      path = "/bla/foo/values[6]/duffy/duck"
      ResponseBodyChecker.new({},{}).send(:relative_path, path).should eql "/bla/foo/*/duffy/duck"
    end
    it 'should substitute more than one absolute adressing in a given path' do
      path = "/bla/foo/values[6]/duffy/friends[1]/duck"
      ResponseBodyChecker.new({},{}).send(:relative_path, path).should eql "/bla/foo/*/duffy/*/duck"
    end
    it "should substiture at the end of the path too" do
      # pending "Had to revert the code change, caused a bug in tree parsing"
      path = "/bla/foo/values[6]/duffy/friends[1]/duck/ibizas[7]"
      ResponseBodyChecker.new({}, {}).send(:relative_path, path).should eql "/bla/foo/*/duffy/*/duck/*"
    end
    it 'should return a string' do
      path = "/bla/foo/values[6]/duffy/friends[1]/duck"
     ResponseBodyChecker.new({},{}).send(:relative_path, path).should be_a(String)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
apirunner-0.5.5 spec/response_body_checker_spec.rb
apirunner-0.5.0 spec/response_body_checker_spec.rb
apirunner-0.4.10 spec/response_body_checker_spec.rb
apirunner-0.4.9 spec/response_body_checker_spec.rb
apirunner-0.4.8 spec/response_body_checker_spec.rb
apirunner-0.4.7 spec/response_body_checker_spec.rb
apirunner-0.4.6 spec/response_body_checker_spec.rb
apirunner-0.4.5 spec/response_body_checker_spec.rb