opal-spec 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +9 -1
- data/lib/opal-spec/browser_formatter.rb +2 -1
- data/lib/opal-spec/expectations.rb +4 -0
- data/lib/opal-spec/matchers.rb +14 -0
- data/lib/opal-spec/version.rb +1 -1
- data/spec/test.rb +17 -0
- metadata +3 -3
data/Rakefile
CHANGED
@@ -63,6 +63,7 @@ module OpalSpec
|
|
63
63
|
|
64
64
|
var summary_element = document.createElement('p');
|
65
65
|
summary_element.className = 'summary';
|
66
|
+
summary_element.innerHTML = "Running...";
|
66
67
|
|
67
68
|
var groups_element = document.createElement('ul');
|
68
69
|
groups_element.className = 'example_groups';
|
@@ -109,7 +110,7 @@ module OpalSpec
|
|
109
110
|
|
110
111
|
var description = document.createElement('span');
|
111
112
|
description.className = 'group_description';
|
112
|
-
description.innerHTML = #{group.description};
|
113
|
+
description.innerHTML = #{group.description.to_s};
|
113
114
|
group_element.appendChild(description);
|
114
115
|
|
115
116
|
var example_list = document.createElement('ul');
|
data/lib/opal-spec/matchers.rb
CHANGED
@@ -59,6 +59,20 @@ module OpalSpec
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
class EqlMatcher < Matcher
|
63
|
+
def match(expected)
|
64
|
+
unless expected == @actual
|
65
|
+
failure "expected: #{expected.inspect}, got: #{@actual.inspect} (using ==)."
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def not_match(expected)
|
70
|
+
if expected.equal? @actual
|
71
|
+
failure "expected: #{expected.inspect} not to be #{@actual.inspect} (using ==)."
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
62
76
|
class EqualMatcher < Matcher
|
63
77
|
def match expected
|
64
78
|
unless expected.equal? @actual
|
data/lib/opal-spec/version.rb
CHANGED
data/spec/test.rb
CHANGED
@@ -19,6 +19,23 @@ describe 'Normal group' do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
describe "New eql" do
|
23
|
+
it "these should both pass" do
|
24
|
+
1.should eq(1)
|
25
|
+
1.should_not eq(2)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "and this should fail" do
|
29
|
+
1.should eq(:adam)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe Object do
|
34
|
+
it "should output a nice name for classes" do
|
35
|
+
1.should eq(1)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
22
39
|
describe 'Another group' do
|
23
40
|
it 'this should pass' do
|
24
41
|
1.should == 1
|
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.
|
4
|
+
version: 0.2.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-
|
12
|
+
date: 2012-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Opal compatible spec library
|
15
15
|
email: adam@adambeynon.com
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 1.8.
|
58
|
+
rubygems_version: 1.8.24
|
59
59
|
signing_key:
|
60
60
|
specification_version: 3
|
61
61
|
summary: Opal compatible spec
|