opal-spec 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
- require 'bundler/setup'
1
+ require 'bundler/setup'
2
+ require 'opal/rake_task'
3
+
4
+ Opal::RakeTask.new do |t|
5
+ t.name = 'opal-spec'
6
+ t.dependencies = []
7
+ end
8
+
9
+ task :default => [:opal]
@@ -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');
@@ -34,6 +34,10 @@ module OpalSpec
34
34
  OpalSpec::BeFalseMatcher.new false
35
35
  end
36
36
 
37
+ def eq(expected)
38
+ OpalSpec::EqlMatcher.new expected
39
+ end
40
+
37
41
  def equal expected
38
42
  OpalSpec::EqualMatcher.new expected
39
43
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OpalSpec
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  end
@@ -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.5
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-10-27 00:00:00.000000000Z
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.11
58
+ rubygems_version: 1.8.24
59
59
  signing_key:
60
60
  specification_version: 3
61
61
  summary: Opal compatible spec