opal-spec 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f1c0478a579f30dd1260e1eac1f4e7fc7ec7de64
4
+ data.tar.gz: 4d1bd16512841732a1dbb24c9af3094b380b7a4f
5
+ SHA512:
6
+ metadata.gz: a537c224a1e36c6c37ceb5dfc17efb60665fd14188a7d48f0052c449f1312e5caf97248371a1ea0d0d265ed2fad2bb1bd5210682cdd0eb56e396323662616e02
7
+ data.tar.gz: bd4212cc0da890c8036c7640f48c94282a5c82f90723d39cc2c0453d085f11cfef58dfc28869dc98de6b4902ebef0b566f5cde40b41ccb1541c8e3685fd626c0
data/Gemfile CHANGED
@@ -1,5 +1,2 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
-
4
- gem 'opal'
5
- gem 'opal-sprockets'
data/README.md CHANGED
@@ -23,6 +23,31 @@ describe MyClass do
23
23
  end
24
24
  ```
25
25
 
26
+ ### Supported notations
27
+
28
+ ````
29
+ * describe "foo" do ... end
30
+ * it "should foo" do ... end
31
+ * before do ... end
32
+ * after do ... end
33
+ * let(:foo) { ... }
34
+ * async # see below
35
+
36
+ * obj.should == other
37
+ * obj.should != other
38
+ * obj.should be_nil
39
+ * obj.should be_true
40
+ * obj.should be_false
41
+ * obj.should be_kind_of(klass)
42
+ * obj.should eq(other) # compare with :==
43
+ * obj.should equal(other) # compare with :equal?
44
+ * obj.should raise_error
45
+ * obj.should be_empty
46
+ * obj.should respond_to(method)
47
+
48
+ * obj.should_not xxx
49
+ ```
50
+
26
51
  ### Async examples
27
52
 
28
53
  Examples can be async, and need to be defined as so:
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'opal'
4
+ gem 'opal-spec'
@@ -0,0 +1,8 @@
1
+ opal-spec example
2
+ =================
3
+
4
+ Running spec
5
+ ------------
6
+
7
+ $ bundle install
8
+ $ rake
@@ -0,0 +1,10 @@
1
+ require 'bundler'
2
+ Bundler.require
3
+
4
+ require 'opal'
5
+ # Help Opal to find your library in ./opal/
6
+ Opal.append_path File.expand_path("opal", File.dirname("__FILE__"))
7
+
8
+ require 'opal/spec/rake_task'
9
+ Opal::Spec::RakeTask.new(:default)
10
+
@@ -0,0 +1,2 @@
1
+ class Stack < Array
2
+ end
@@ -0,0 +1,2 @@
1
+ require 'opal-spec'
2
+ require 'stack'
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Stack do
4
+ before do
5
+ @stack = Stack.new
6
+ end
7
+
8
+ it "should be initially empty" do
9
+ @stack.empty?.should be_true
10
+ end
11
+
12
+ it "can contain an object" do
13
+ @stack.push(1)
14
+ @stack.pop.should == 1
15
+ end
16
+ end
17
+
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Spec
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.require_paths = ['lib']
15
15
 
16
- s.add_dependency 'opal', '~> 0.4.4'
17
- s.add_dependency 'opal-sprockets', '~> 0.2.0'
16
+ s.add_dependency 'opal', '~> 0.5.0'
17
+ s.add_dependency 'opal-sprockets', '~> 0.3.0'
18
18
 
19
19
  s.add_development_dependency 'rake'
20
20
  end
@@ -70,6 +70,10 @@ module OpalSpec
70
70
  `#{ @element }.innerHTML = html`
71
71
  end
72
72
 
73
+ def text=(text)
74
+ self.html = text.gsub(/</, '&lt').gsub(/>/, '&gt')
75
+ end
76
+
73
77
  def type=(type)
74
78
  `#{ @element }.type = type`
75
79
  end
@@ -108,7 +112,7 @@ module OpalSpec
108
112
 
109
113
  @summary_element = Node.create 'p'
110
114
  @summary_element.class_name = "summary"
111
- @summary_element.html = "Runner..."
115
+ @summary_element.text = "Runner..."
112
116
 
113
117
  @groups_element = Node.create("ul")
114
118
  @groups_element.class_name = "example_groups"
@@ -129,7 +133,7 @@ module OpalSpec
129
133
  time = Time.now.to_f - @start_time
130
134
  text = "\n#{example_count} examples, #{@failed_examples.size} failures (time taken: #{time})"
131
135
 
132
- @summary_element.html = text
136
+ @summary_element.text = text
133
137
  end
134
138
 
135
139
  def example_group_started group
@@ -140,7 +144,7 @@ module OpalSpec
140
144
 
141
145
  description = Node.create("span")
142
146
  description.class_name = "group_description"
143
- description.html = group.description.to_s
147
+ description.text = group.description.to_s
144
148
  @group_element.append description
145
149
 
146
150
  @example_list = Node.create "ul"
@@ -182,11 +186,11 @@ module OpalSpec
182
186
 
183
187
  description = Node.create "span"
184
188
  description.class_name = "example_description"
185
- description.html = example.description.to_s
189
+ description.text = example.description.to_s
186
190
 
187
191
  exception = Node.create "pre"
188
192
  exception.class_name = "exception"
189
- exception.html = output
193
+ exception.text = output
190
194
 
191
195
  wrapper.append description
192
196
  wrapper.append exception
@@ -201,7 +205,7 @@ module OpalSpec
201
205
 
202
206
  description = Node.create "span"
203
207
  description.class_name = "example_description"
204
- description.html = example.description.to_s
208
+ description.text = example.description.to_s
205
209
 
206
210
  wrapper.append description
207
211
  @example_list.append wrapper
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
5
- prerelease:
4
+ version: 0.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Adam Beynon
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-29 00:00:00.000000000 Z
11
+ date: 2013-11-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: opal
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 0.4.4
19
+ version: 0.5.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 0.4.4
26
+ version: 0.5.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: opal-sprockets
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: 0.2.0
33
+ version: 0.3.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: 0.2.0
40
+ version: 0.3.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description: Opal compatible spec library
@@ -70,6 +63,12 @@ files:
70
63
  - README.md
71
64
  - Rakefile
72
65
  - config.ru
66
+ - example/Gemfile
67
+ - example/README.md
68
+ - example/Rakefile
69
+ - example/opal/stack.rb
70
+ - example/spec/spec_helper.rb
71
+ - example/spec/stack_spec.rb
73
72
  - lib/opal-spec.rb
74
73
  - lib/opal/spec.rb
75
74
  - lib/opal/spec/rake_task.rb
@@ -91,26 +90,25 @@ files:
91
90
  - vendor/spec_runner.js
92
91
  homepage: http://opalrb.org
93
92
  licenses: []
93
+ metadata: {}
94
94
  post_install_message:
95
95
  rdoc_options: []
96
96
  require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
- none: false
100
99
  requirements:
101
- - - ! '>='
100
+ - - '>='
102
101
  - !ruby/object:Gem::Version
103
102
  version: '0'
104
103
  required_rubygems_version: !ruby/object:Gem::Requirement
105
- none: false
106
104
  requirements:
107
- - - ! '>='
105
+ - - '>='
108
106
  - !ruby/object:Gem::Version
109
107
  version: '0'
110
108
  requirements: []
111
109
  rubyforge_project:
112
- rubygems_version: 1.8.23
110
+ rubygems_version: 2.1.9
113
111
  signing_key:
114
- specification_version: 3
112
+ specification_version: 4
115
113
  summary: Opal compatible spec
116
114
  test_files: []