opal-spec 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/opal-spec/autorun.rb +21 -0
- data/lib/opal-spec/dom.rb +9 -0
- data/lib/opal-spec/runner.rb +9 -20
- data/lib/opal-spec/version.rb +1 -1
- data/lib/opal-spec.rb +1 -1
- metadata +4 -3
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'opal-spec'
|
2
|
+
|
3
|
+
OpalSpec.on_dom_ready do
|
4
|
+
Dir[OpalSpec.autorun_glob].each do |s|
|
5
|
+
require s
|
6
|
+
end
|
7
|
+
|
8
|
+
OpalSpec::Runner.new.run
|
9
|
+
end
|
10
|
+
|
11
|
+
module OpalSpec
|
12
|
+
@autorun_glob = "spec/**/*"
|
13
|
+
|
14
|
+
def self.autorun_glob
|
15
|
+
@autorun_glob
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.autorun_glob=(glob)
|
19
|
+
@autorun_glob = glob
|
20
|
+
end
|
21
|
+
end
|
data/lib/opal-spec/dom.rb
CHANGED
data/lib/opal-spec/runner.rb
CHANGED
@@ -1,45 +1,34 @@
|
|
1
|
-
# cheat until proper method available..
|
2
|
-
%x{
|
3
|
-
setTimeout(function() {
|
4
|
-
#{OpalSpec::Runner.new.run}
|
5
|
-
}, 0);
|
6
|
-
}
|
7
|
-
|
8
1
|
module OpalSpec
|
9
2
|
class Runner
|
10
|
-
# def self.autorun
|
11
|
-
# at_exit { OpalSpec::Runner.new.run }
|
12
|
-
# end
|
13
|
-
|
14
3
|
def initialize
|
15
|
-
@
|
4
|
+
@formatter = BrowserFormatter.new
|
16
5
|
end
|
17
6
|
|
18
7
|
def run
|
19
8
|
groups = ExampleGroup.example_groups
|
20
|
-
@
|
9
|
+
@formatter.start
|
21
10
|
groups.each { |group| group.run self }
|
22
|
-
@
|
11
|
+
@formatter.finish
|
23
12
|
end
|
24
13
|
|
25
14
|
def example_group_started group
|
26
|
-
@
|
15
|
+
@formatter.example_group_started group
|
27
16
|
end
|
28
17
|
|
29
18
|
def example_group_finished group
|
30
|
-
@
|
19
|
+
@formatter.example_group_finished group
|
31
20
|
end
|
32
21
|
|
33
22
|
def example_started example
|
34
|
-
@
|
23
|
+
@formatter.example_started example
|
35
24
|
end
|
36
25
|
|
37
26
|
def example_passed example
|
38
|
-
@
|
27
|
+
@formatter.example_passed example
|
39
28
|
end
|
40
29
|
|
41
30
|
def example_failed example
|
42
|
-
@
|
31
|
+
@formatter.example_failed example
|
43
32
|
end
|
44
33
|
end
|
45
|
-
end
|
34
|
+
end
|
data/lib/opal-spec/version.rb
CHANGED
data/lib/opal-spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'opal-spec/example_group'
|
|
3
3
|
require 'opal-spec/matchers'
|
4
4
|
require 'opal-spec/runner'
|
5
5
|
require 'opal-spec/scratch_pad'
|
6
|
-
require 'opal-spec/
|
6
|
+
require 'opal-spec/expectations'
|
7
7
|
require 'opal-spec/browser_formatter'
|
8
8
|
require 'opal-spec/dom'
|
9
9
|
require 'opal-spec/kernel'
|
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.1.
|
4
|
+
version: 0.1.6
|
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: 2012-05-
|
12
|
+
date: 2012-05-29 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Opal compatible spec
|
15
15
|
email: adam@adambeynon.com
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- example/runner.html
|
30
30
|
- example/spec_helper.rb
|
31
31
|
- lib/opal-spec.rb
|
32
|
+
- lib/opal-spec/autorun.rb
|
32
33
|
- lib/opal-spec/browser_formatter.rb
|
33
34
|
- lib/opal-spec/dom.rb
|
34
35
|
- lib/opal-spec/example.rb
|
@@ -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.
|
64
|
+
rubygems_version: 1.8.11
|
64
65
|
signing_key:
|
65
66
|
specification_version: 3
|
66
67
|
summary: Opal compatible spec
|