opal-spec 0.2.1 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
- gem "opal", :git => 'git://github.com/opal/opal.git'
2
- gem "rake"
1
+ source :rubygems
2
+
3
+ gem 'rake'
4
+ gem 'opal'
data/Rakefile CHANGED
@@ -1,8 +1 @@
1
- require 'bundler'
2
- Bundler.setup
3
-
4
- require 'opal/rake_task'
5
-
6
- Opal::RakeTask.new do |t|
7
- t.name = 'opal-spec'
8
- end
1
+ require 'bundler/setup'
@@ -77,8 +77,16 @@ module OpalSpec
77
77
  target.appendChild(groups_element);
78
78
 
79
79
  var styles = document.createElement('style');
80
- styles.innerHTML = #{ CSS };
81
- document.head.appendChild(styles);
80
+ styles.type = 'text/css';
81
+
82
+ if (styles.styleSheet) {
83
+ styles.styleSheet.cssText = __scope.CSS;
84
+ }
85
+ else {
86
+ styles.appendChild(document.createTextNode(__scope.CSS));
87
+ }
88
+
89
+ document.getElementsByTagName('head')[0].appendChild(styles);
82
90
  }
83
91
 
84
92
  @start_time = Time.now.to_f
@@ -30,7 +30,7 @@ module OpalSpec
30
30
  class BeKindOfMatcher < Matcher
31
31
  def match expected
32
32
  unless expected.kind_of? @actual
33
- failure "expected #{expected.inspect} to be a kind of #{@actual}, not #{expected.class}."
33
+ failure "expected #{expected.inspect} to be a kind of #{@actual.name}, not #{expected.class.name}."
34
34
  end
35
35
  end
36
36
  end
@@ -6,7 +6,7 @@ module OpalSpec
6
6
  end
7
7
 
8
8
  def log_green(str)
9
- `console.log('\\033[92m' + str + '\\033[0m')`
9
+ `console.log('\\033[32m' + str + '\\033[0m')`
10
10
  end
11
11
 
12
12
  def log_red(str)
@@ -18,12 +18,14 @@ module OpalSpec
18
18
  end
19
19
 
20
20
  def start
21
+ @start_time = Time.now.to_f
21
22
  end
22
23
 
23
24
  def finish
25
+ time = Time.now.to_f - @start_time
24
26
  if @failed_examples.empty?
25
27
  log "\nFinished"
26
- log_green "#{example_count} examples, 0 failures"
28
+ log_green "#{example_count} examples, 0 failures (time taken: #{time})"
27
29
  finish_with_code(0)
28
30
  else
29
31
  log "\nFailures:"
@@ -42,7 +44,7 @@ module OpalSpec
42
44
  end
43
45
 
44
46
  log "\nFinished"
45
- log_red "#{example_count} examples, #{@failed_examples.size} failures"
47
+ log_red "#{example_count} examples, #{@failed_examples.size} failures (time taken: #{time})"
46
48
  finish_with_code(1)
47
49
  end
48
50
  end
@@ -1,3 +1,3 @@
1
1
  module OpalSpec
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.5'
3
3
  end
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.1
4
+ version: 0.2.5
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-09-17 00:00:00.000000000Z
12
+ date: 2012-10-27 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Opal compatible spec library
15
15
  email: adam@adambeynon.com