Skip to content

Commit

Permalink
Added the travis file
Browse files Browse the repository at this point in the history
  • Loading branch information
fd committed May 23, 2011
1 parent 5f759f7 commit 983174c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rvm:
- 1.8.7
- 1.9.1
- 1.9.2
- jruby
- rbx
- ree
3 changes: 1 addition & 2 deletions lib/json_select/selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def match(object)
matches
end

alias_method :evaluate, :match
alias_method :=~, :match
alias_method :=~, :match

def test(object)
_each(@ast, object, nil, nil, nil) do |object|
Expand Down
9 changes: 8 additions & 1 deletion spec/conformance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
s = JSONSelect(File.read(selector).strip)
e = []
Yajl::Parser.parse(File.read(output)) { |o| e << o }
s.evaluate(input).should == e
s.match(input).should == e
end

it "can correctly test the object" do
s = JSONSelect(File.read(selector).strip)
e = []
Yajl::Parser.parse(File.read(output)) { |o| e << o }
s.test(input).should be_true
end

end
Expand Down

0 comments on commit 983174c

Please sign in to comment.