opal-spec 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
- #= require opal
2
- #= require opal/spec/example
3
- #= require opal/spec/example_group
4
- #= require opal/spec/matchers
5
- #= require opal/spec/runner
6
- #= require opal/spec/scratch_pad
7
- #= require opal/spec/expectations
8
- #= require opal/spec/browser_formatter
9
- #= require opal/spec/phantom_formatter
10
- #= require opal/spec/kernel
1
+ require 'opal'
2
+ require 'opal/spec/example'
3
+ require 'opal/spec/example_group'
4
+ require 'opal/spec/matchers'
5
+ require 'opal/spec/runner'
6
+ require 'opal/spec/scratch_pad'
7
+ require 'opal/spec/expectations'
8
+ require 'opal/spec/browser_formatter'
9
+ require 'opal/spec/phantom_formatter'
10
+ require 'opal/spec/kernel'
11
11
 
12
12
  # Compatibility with older versions
13
13
  OpalSpec = Opal::Spec
@@ -1 +1 @@
1
- #= require opal/spec
1
+ require 'opal/spec'
@@ -0,0 +1,52 @@
1
+ require 'opal/spec'
2
+
3
+ module Opal
4
+ module Spec
5
+ class RakeTask
6
+ include Rake::DSL if defined? Rake::DSL
7
+
8
+ attr_accessor :name
9
+ attr_writer :runner_path, :url_path, :port
10
+
11
+ def initialize(name = 'opal:spec')
12
+ @name = name
13
+ yield self if block_given?
14
+
15
+ define_tasks
16
+ end
17
+
18
+ def define_tasks
19
+ desc "Run opal specs in phantomjs"
20
+ task @name do
21
+ require 'rack'
22
+ require 'webrick'
23
+
24
+ server = fork do
25
+ Rack::Server.start(:config => 'config.ru', :Port => port,
26
+ :Logger => WEBrick::Log.new("/dev/null"), :AccessLog => [])
27
+ end
28
+
29
+ system "phantomjs #{runner_path} \"#{url_path}\""
30
+ success = $?.success?
31
+
32
+ Process.kill(:SIGINT, server)
33
+ Process.wait
34
+
35
+ exit 1 unless success
36
+ end
37
+ end
38
+
39
+ def runner_path
40
+ @runner_path || File.join(File.dirname(__FILE__), '..', '..', '..', 'vendor', 'runner.js')
41
+ end
42
+
43
+ def url_path
44
+ @url_path || "http://localhost:9999/"
45
+ end
46
+
47
+ def port
48
+ @port || 9999
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Spec
3
- VERSION = '0.2.7'
3
+ VERSION = '0.2.8'
4
4
  end
5
5
  end
data/spec/specs.rb CHANGED
@@ -1,5 +1,5 @@
1
- #= require opal
2
- #= require opal-spec
1
+ require 'opal'
2
+ require 'opal-spec'
3
3
 
4
4
  @passed = 0
5
5
  @failures = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000Z
12
+ date: 2013-02-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Opal compatible spec library
15
15
  email: adam.beynon@gmail.com
@@ -34,6 +34,7 @@ files:
34
34
  - lib/assets/javascripts/opal/spec/scratch_pad.rb
35
35
  - lib/opal-spec.rb
36
36
  - lib/opal/spec.rb
37
+ - lib/opal/spec/rake_task.rb
37
38
  - lib/opal/spec/runner.rb
38
39
  - lib/opal/spec/version.rb
39
40
  - opal-spec.gemspec
@@ -60,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
61
  version: '0'
61
62
  requirements: []
62
63
  rubyforge_project:
63
- rubygems_version: 1.8.11
64
+ rubygems_version: 1.8.23
64
65
  signing_key:
65
66
  specification_version: 3
66
67
  summary: Opal compatible spec