opal-minitest 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: beef9c7e7889e199cee93efe1c4830ce67d8eb95
4
- data.tar.gz: c5f7bf324fa9081575845ecb604ea12d81f30b33
3
+ metadata.gz: ba8c2924d574f50f708f738f8d873557d07642c5
4
+ data.tar.gz: 05e850d0ddd55515e9bcc4b94ff4f6cfe2144151
5
5
  SHA512:
6
- metadata.gz: 695b862c482ed1ce1f63af2f8b5a86640a793fb1c96c32dbbbf5e58c260fd2840c2c221c7a24dea113ca1c13499b4e7e606b421e6549198098b420127bf86a9b
7
- data.tar.gz: 0d3b6e926cdc96cabc184d9c566bc3f902e453bf15df70f6f88f3855d98e6fc82d83c57f2365eb596880456f8005dc2035bf58ae1ca89ff2978d748bb8709bfa
6
+ metadata.gz: f87debdef932a42ce1063e41d4fe442973fb2f6c91061254f31fcadc6212495fa762db1d831d33fb08634e00c77b115c468fba8dd1ed8d902f940b57e81615d3
7
+ data.tar.gz: 896d04fe40f67de7afcea40209f09a62a8d8204aefe363e5446e93289721c1b66ee717299c3c5a00650c5a043290d3fde94f7e265ee9f94b2f00cffcdcf9b9f1
@@ -1,3 +1,10 @@
1
+ 0.0.5 (2015-10-18)
2
+ ------------------
3
+ * Support Opal v0.8
4
+ * Support PhantomJS v2
5
+ * Support working directory with spaces
6
+ * Extend example
7
+
1
8
  0.0.4 (2014-09-10)
2
9
  ------------------
3
10
  * RakeTask initializer takes arguments hash
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'opal', github: 'opal/opal', ref: '7e843b0'
1
+ source 'https://rubygems.org'
4
2
 
5
3
  gemspec
data/README.md CHANGED
@@ -13,20 +13,20 @@ gem 'opal-minitest'
13
13
 
14
14
  `$ bundle install`
15
15
 
16
- Finally, use the included Rake task to headlessly run the project's tests.
16
+ Include the Rake task in a Rakefile, then run `rake` to run the project's tests.
17
17
 
18
18
  ```ruby
19
19
  # Rakefile
20
20
  require 'opal/minitest/rake_task'
21
- Opal::Minitest::RakeTask.new(name: :default)
21
+ Opal::Minitest::RakeTask.new
22
22
  ```
23
23
 
24
24
  `$ bundle exec rake`
25
25
 
26
- This will run all Ruby/Opal files ending in `_test` in the `test/` directory, after an optional `test_helper` file in the same directory. Try the example!
26
+ This will run all Ruby/Opal files ending in `_test` in the `test/` directory, after an optional `test_helper` file. Try the example!
27
27
 
28
28
  ## Status
29
29
 
30
- Opal Minitest can currently do everything regular Minitest can, except parallel running, plugins, CLI options, and `#capture_subprocess_io`.
30
+ Opal Minitest can do everything regular Minitest can, except parallel running, plugins, CLI options, and `#capture_subprocess_io`.
31
31
 
32
- Any code differences in the port from regular Minitest are documented with an `OMT` label.
32
+ All code differences from regular Minitest are documented with the label `PORT`.
data/Rakefile CHANGED
@@ -1,2 +1,2 @@
1
1
  require 'opal/minitest/rake_task'
2
- Opal::Minitest::RakeTask.new(name: :default)
2
+ Opal::Minitest::RakeTask.new
@@ -1,4 +1,3 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'opal-minitest', path: '../'
4
- gem 'minitest', '~> 5.3.2'
@@ -3,8 +3,7 @@ require 'opal/minitest/rake_task'
3
3
  # Register code in /opal with Opal.
4
4
  Opal.append_path File.expand_path('../opal', __FILE__)
5
5
 
6
- Opal::Minitest::RakeTask.new(:default)
7
-
6
+ Opal::Minitest::RakeTask.new
8
7
 
9
8
  desc "Run tests through regular Minitest"
10
9
  task('regtest') do
@@ -1,5 +1,15 @@
1
1
  class Bacterium
2
+ attr_accessor :food
3
+
4
+ def initialize
5
+ @food = []
6
+ end
7
+
2
8
  def reproduce
3
9
  self.class.new
4
10
  end
11
+
12
+ def eat(object)
13
+ food << object
14
+ end
5
15
  end
@@ -2,10 +2,16 @@ require 'bacterium'
2
2
 
3
3
  class BacteriumTest < Minitest::Test
4
4
  def setup
5
- @object = Bacterium.new
5
+ @bacterium = Bacterium.new
6
6
  end
7
7
 
8
- def test_reproduce_returns_genetic_clone
9
- assert_equal(@object.reproduce.class, @object.class)
8
+ def test_reproduce_returns_clone
9
+ assert_equal(@bacterium.reproduce.class, @bacterium.class)
10
+ end
11
+
12
+ def test_eat_adds_bacterium_to_food
13
+ object = Object.new
14
+ @bacterium.eat(object)
15
+ assert_includes(@bacterium.food, object)
10
16
  end
11
17
  end
@@ -1 +1 @@
1
- puts "I am test helper."
1
+ puts "Use test_helper.rb to define helpful methods for your tests."
@@ -8,13 +8,14 @@ module Opal
8
8
 
9
9
  RUNNER_PATH = File.expand_path('../../../../vendor/runner.js', __FILE__)
10
10
 
11
- def initialize(args)
11
+ def initialize(args = {})
12
12
  args = defaults.merge(args)
13
13
 
14
14
  desc "Run tests through opal-minitest"
15
15
  task(args[:name]) do
16
16
  require 'rack'
17
17
  require 'webrick'
18
+ require 'tilt/erb'
18
19
 
19
20
  server = fork {
20
21
  Rack::Server.start(
@@ -25,7 +26,7 @@ module Opal
25
26
  AccessLog: [])
26
27
  }
27
28
 
28
- system "phantomjs #{RUNNER_PATH} \"http://localhost:#{args[:port]}\""
29
+ system "phantomjs \"#{RUNNER_PATH}\" \"http://localhost:#{args[:port]}\""
29
30
 
30
31
  Process.kill(:SIGINT, server)
31
32
  Process.wait
@@ -36,7 +37,7 @@ module Opal
36
37
 
37
38
  def defaults
38
39
  {
39
- name: 'opal:minitest',
40
+ name: 'default',
40
41
  port: 2838,
41
42
  requires_glob: 'test/{test_helper,**/*_test}.{rb,opal}'
42
43
  }
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Minitest
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
@@ -7,17 +7,19 @@ require 'opal/minitest/version'
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'opal-minitest'
9
9
  s.version = Opal::Minitest::VERSION
10
- s.author = 'Artur Ostrega'
11
- s.email = 'skoofoo@gmail.com'
12
10
  s.summary = 'Minitest, now for Opal!'
13
11
  s.description = 'Minitest test runner for Opal'
12
+ s.license = 'MIT'
13
+ s.homepage = 'https://github.com/aost/opal-minitest'
14
+ s.author = 'Artur Ostręga'
15
+ s.email = 'artmarost@gmail.com'
14
16
 
15
17
  s.files = `git ls-files`.split("\n")
16
18
 
17
- s.require_paths = ['lib']
19
+ s.require_paths = ['lib']
18
20
 
19
- s.add_dependency 'opal', '>= 0.6'
20
- s.add_dependency 'rake', '~> 10.3'
21
+ s.add_dependency 'opal', '>= 0.8'
22
+ s.add_dependency 'rake', '~> 10'
21
23
  s.add_development_dependency 'minitest', '5.3.4'
22
24
  end
23
25
 
@@ -1,8 +1,8 @@
1
- <% require_asset 'opal' %>
2
- <% require_asset 'minitest' %>
1
+ require 'opal'
2
+ require 'minitest'
3
3
 
4
- <% Dir[$omt_requires_glob].each { |file|
5
- require_asset file.sub(/^test\//, '').sub(/\.{rb,opal}$/, '')
6
- } %>
4
+ <% Dir[$omt_requires_glob].each do |file| %>
5
+ require <%= file.sub(/^test\//, '').sub(/\.{rb,opal}$/, '').inspect %>
6
+ <% end %>
7
7
 
8
8
  Minitest.run
@@ -1,6 +1,8 @@
1
1
  // Headlessly open test loader and wait until tests finish.
2
2
 
3
- var url = phantom.args[0],
3
+ var system = require('system');
4
+
5
+ var url = system.args[1],
4
6
  page = require('webpage').create();
5
7
 
6
8
  page.onConsoleMessage = function(msg) { console.log(msg) };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - Artur Ostrega
7
+ - Artur Ostręga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '0.6'
19
+ version: '0.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '0.6'
26
+ version: '0.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '10.3'
33
+ version: '10'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '10.3'
40
+ version: '10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 5.3.4
55
55
  description: Minitest test runner for Opal
56
- email: skoofoo@gmail.com
56
+ email: artmarost@gmail.com
57
57
  executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
@@ -80,8 +80,9 @@ files:
80
80
  - opal/opal/minitest/runner.html.erb
81
81
  - test/example_test.rb
82
82
  - vendor/runner.js
83
- homepage:
84
- licenses: []
83
+ homepage: https://github.com/aost/opal-minitest
84
+ licenses:
85
+ - MIT
85
86
  metadata: {}
86
87
  post_install_message:
87
88
  rdoc_options: []
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  version: '0'
100
101
  requirements: []
101
102
  rubyforge_project:
102
- rubygems_version: 2.2.2
103
+ rubygems_version: 2.0.14
103
104
  signing_key:
104
105
  specification_version: 4
105
106
  summary: Minitest, now for Opal!