Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:tenderlove/taka
* 'master' of github.com:tenderlove/taka: adding some necessary JS properties to DOM::Document and DOM::Node fixing the load-path for jquery test js files yo dawg, I hear you like console.log when you shave yaks refactored jquery tests into separate file, and made it a little nicer to use a dev version of johnson.
- Loading branch information
Showing
5 changed files
with
77 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helper')) | ||
|
||
module JQuery | ||
class TestJQuery < TestCase | ||
|
||
def test_jquery | ||
Dir.chdir 'vendor/jquery' do | ||
doc = Taka::DOM::HTML(File.read('jquery/test/index.html')) | ||
scripts = doc.getElementsByTagName 'script' | ||
rt = Johnson::Runtime.new | ||
|
||
rt['window'] = FakeWindow.new | ||
rt['navigator'] = FakeNavigator.new | ||
rt['console'] = PoorMansFirebug.new | ||
rt['document'] = doc | ||
|
||
scripts.each do |tag| | ||
if tag['src'] | ||
filename = File.expand_path(tag['src'].sub('../dist', 'jquery/dist')) | ||
puts "(running #{tag['src']} ...)" ; STDOUT.flush | ||
rt.evaluate File.read(filename), filename, 1 | ||
else | ||
rt.evaluate tag.content | ||
end | ||
end | ||
end | ||
end | ||
|
||
end | ||
end |