Skip to content

Commit

Permalink
Merge pull request #87 from teamcapybara/version_work
Browse files Browse the repository at this point in the history
Move towards a 3.0 release
  • Loading branch information
twalpole committed Dec 27, 2017
2 parents 3d08401 + 6e6a7e2 commit d3c74ae
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 135 deletions.
15 changes: 12 additions & 3 deletions .travis.yml
Expand Up @@ -6,6 +6,15 @@ env:
- JAVA_OPTS=-Djava.security.egd=file:/dev/urandom

rvm:
- 2.3.3
- 2.4.1
- jruby-9.1.8.0
- 2.2
- 2.3
- 2.4
- jruby-9.1.15.0
- 2.5

matrix:
allow_failures:
- rvm: 2.5

before_install:
- gem update bundler
2 changes: 1 addition & 1 deletion lib/xpath/version.rb
@@ -1,3 +1,3 @@
module XPath
VERSION = '2.1.0'
VERSION = '3.0.0.dev'
end
16 changes: 8 additions & 8 deletions spec/union_spec.rb
Expand Up @@ -9,7 +9,7 @@
@expr1 = XPath.generate { |x| x.descendant(:p) }
@expr2 = XPath.generate { |x| x.descendant(:div) }
@collection = XPath::Union.new(@expr1, @expr2)
@collection.expressions.should == [@expr1, @expr2]
@collection.expressions.should eq [@expr1, @expr2]
end
end

Expand All @@ -20,7 +20,7 @@
@collection = XPath::Union.new(@expr1, @expr2)
exprs = []
@collection.each { |expr| exprs << expr }
exprs.should == [@expr1, @expr2]
exprs.should eq [@expr1, @expr2]
end
end

Expand All @@ -29,7 +29,7 @@
@expr1 = XPath.generate { |x| x.descendant(:p) }
@expr2 = XPath.generate { |x| x.descendant(:div) }
@collection = XPath::Union.new(@expr1, @expr2)
@collection.map { |expr| expr.expression }.should == [:descendant, :descendant]
@collection.map { |expr| expr.expression }.should eq [:descendant, :descendant]
end
end

Expand All @@ -39,9 +39,9 @@
@expr2 = XPath.generate { |x| x.descendant(:div).where(x.attr(:id) == 'foo') }
@collection = XPath::Union.new(@expr1, @expr2)
@results = doc.xpath(@collection.to_xpath)
@results[0][:title].should == 'fooDiv'
@results[1].text.should == 'Blah'
@results[2].text.should == 'Bax'
@results[0][:title].should eq 'fooDiv'
@results[1].text.should eq 'Blah'
@results[2].text.should eq 'Bax'
end
end

Expand All @@ -54,9 +54,9 @@
@xpath1 = @collection.where(XPath.attr(:id) == 'foo').to_xpath
@xpath2 = @collection.where(XPath.attr(:id) == 'fooDiv').to_xpath
@results = doc.xpath(@xpath1)
@results[0][:title].should == 'fooDiv'
@results[0][:title].should eq 'fooDiv'
@results = doc.xpath(@xpath2)
@results[0][:id].should == 'fooDiv'
@results[0][:id].should eq 'fooDiv'
end
end

Expand Down

0 comments on commit d3c74ae

Please sign in to comment.