diff --git a/README.md b/README.md index cc13bea..7fde3a9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ To add new coffeescript test, add those file to the /integration/coffeescript/ip To add new javascript test, if the iphone and ipad folder don't exist in the /integration/javascript forlder, create them. Then copy your test file inside those folder depending on your target. Your file hierarchy should look something like this +
| integration
| coffeescript
@@ -34,11 +35,13 @@ Your file hierarchy should look something like this
| exemple.coffee
| ipad
| example.coffee
+ | universal
| javascript
| iphone
| myTest.js
| ipad
| myiPadtest.js
+ | universal
|tmp
diff --git a/lib/bwoken/cli/init.rb b/lib/bwoken/cli/init.rb
index b347111..3d50e68 100644
--- a/lib/bwoken/cli/init.rb
+++ b/lib/bwoken/cli/init.rb
@@ -28,7 +28,10 @@ def initialize opts
def run
directory "coffeescript/iphone"
directory "coffeescript/ipad"
- directory "javascript"
+ directory "coffeescript/universal"
+ directory "javascript/iphone"
+ directory "javascript/ipad"
+ directory "javascript/universal"
directory "tmp/results"
template "coffeescript/iphone/example.coffee"
template "coffeescript/ipad/example.coffee"
diff --git a/lib/bwoken/device_runner.rb b/lib/bwoken/device_runner.rb
index 5b74731..cb04c09 100644
--- a/lib/bwoken/device_runner.rb
+++ b/lib/bwoken/device_runner.rb
@@ -43,8 +43,10 @@ def script_filenames
end
def test_files_from_feature_names
- feature_names.map do |feature_name|
- File.join(Bwoken.test_suite_path, device_family, "#{feature_name}.js")
+ all_test_files.select do |file_name|
+ feature_names.any? do |feature_name|
+ file_name.include?(feature_name)
+ end
end
end
@@ -53,11 +55,13 @@ def all_test_files
end
def all_files_in_test_dir
- Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"]
+ Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"] +
+ Dir["#{Bwoken.test_suite_path}/universal/**/*.js"]
end
def helper_files
- Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"]
+ Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"] +
+ Dir["#{Bwoken.test_suite_path}/universal/**/helpers/**/*.js"]
end
end
diff --git a/lib/bwoken/script.rb b/lib/bwoken/script.rb
index 96d8c1f..b83c1a8 100644
--- a/lib/bwoken/script.rb
+++ b/lib/bwoken/script.rb
@@ -48,7 +48,7 @@ def device_flag
if !device.nil?
return "-w \"#{device}\""
end
-
+
simulator ? '' : "-w #{Bwoken::Device.uuid}"
end
diff --git a/lib/bwoken/simulator_runner.rb b/lib/bwoken/simulator_runner.rb
index 1b9142b..36d697b 100644
--- a/lib/bwoken/simulator_runner.rb
+++ b/lib/bwoken/simulator_runner.rb
@@ -44,8 +44,10 @@ def script_filenames
end
def test_files_from_feature_names
- feature_names.map do |feature_name|
- File.join(Bwoken.test_suite_path, device_family, "#{feature_name}.js")
+ all_test_files.select do |file_name|
+ feature_names.any? do |feature_name|
+ file_name.include?(feature_name)
+ end
end
end
@@ -54,11 +56,13 @@ def all_test_files
end
def all_files_in_test_dir
- Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"]
+ Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"] +
+ Dir["#{Bwoken.test_suite_path}/universal/**/*.js"]
end
def helper_files
- Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"]
+ Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"] +
+ Dir["#{Bwoken.test_suite_path}/universal/**/helpers/**/*.js"]
end
end