opal-rspec 0.3.0.beta3 → 0.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84230cf1d8509f28c633e0e882d33c09f1246b24
4
- data.tar.gz: aec3b03f1a636f28f306cac7fda0dc96a1315d93
3
+ metadata.gz: 707686eaa0a318ed51bb52e8ed2b42e23c916f7b
4
+ data.tar.gz: 195fc3010866a2db5c5c173cf9932de2488dcdac
5
5
  SHA512:
6
- metadata.gz: 9cdd2b63ace9e719b2c96af8e81120086c7840d5169b5691732bdd71b56b84731cfeb6d4a07abb4bd4ff6f6d4e984b802b00bdd7b0f66015e617a4041bc0d1ca
7
- data.tar.gz: fa734e9b5618dc8d10944f253f6028d1e7850223b2919d44b32677bea6f53dbd42de1b04c09623bdd420958b1553148a1250642b36d1f4d099da1fb26ee12ea9
6
+ metadata.gz: 41cc46cbb89db2ea116e6f67cc36386fe314e6cdfcea6de6417c0f940ffba405131bf42fc98b19477036f7414d0392dd7ca3368b7d1c8a5f764a8dbd00dbd6fb
7
+ data.tar.gz: 967b2922615395e984b1f5ceff349a4efa6ac125b5c297b9b13b9bd0a55f41e560c8204b52a072cdc82cd25d818519ae031cffa24c2bed7006cfc7e58620fac3
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem 'opal', :github => 'opal/opal'
4
+ gem 'opal', :github => 'opal/opal'
5
5
 
6
6
  gem 'rake'
7
7
 
data/Rakefile CHANGED
@@ -21,20 +21,33 @@ end
21
21
 
22
22
  def build_rspec
23
23
  Opal::Processor.dynamic_require_severity = :warning
24
- Opal.append_path 'app'
25
24
 
26
- Opal.use_gem 'rspec'
27
- Opal.use_gem 'rspec-expectations'
25
+ code = []
26
+ gems = %w(rspec rspec-core rspec-support rspec-expectations rspec-mocks)
28
27
 
29
- %w[time fileutils test/unit/assertions coderay optparse shellwords socket uri
30
- drb/drb diff/lcs diff/lcs/hunk].each do |asset|
31
- Opal::Processor.stub_file asset
28
+ gems.each do |gem_name|
29
+ spec = Gem::Specification.find_by_name gem_name
30
+ gem_dir = File.join spec.gem_dir, 'lib'
31
+ prefix = gem_dir + '/'
32
+
33
+ Dir.glob(File.join(gem_dir, '**/*.rb')).each do |source|
34
+ requirable = source.sub(prefix, '').sub(/\.rb$/, '')
35
+
36
+ compiler = Opal::Compiler.new File.read(source),
37
+ requirable: true, file: requirable, dynamic_require_severity: :warning
38
+
39
+ code << compiler.compile
40
+ end
32
41
  end
33
42
 
34
- # bug in rspec? this autoload doesnt exist so we must stub it
35
- Opal::Processor.stub_file 'rspec/matchers/built_in/have'
43
+ stubs = %w(shellwords fileutils optparse)
44
+
45
+ stubs.each do |stub|
46
+ compiler = Opal::Compiler.new '', requirable: true, file: stub
47
+ code << compiler.compile
48
+ end
36
49
 
37
- Opal.process('rspec-builder')
50
+ code.join "\n"
38
51
  end
39
52
 
40
53
  def uglify(str)
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module RSpec
3
- VERSION = '0.3.0.beta3'
3
+ VERSION = '0.4.0.beta1'
4
4
  end
5
5
  end
data/opal-rspec.gemspec CHANGED
@@ -15,8 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.require_paths = ['lib']
17
17
 
18
- s.add_dependency 'opal', ['>= 0.6.0', '< 1.0.0']
19
-
18
+ s.add_dependency 'opal', '~> 0.7.0.dev'
20
19
  s.add_development_dependency 'rake'
21
20
  end
22
21
 
data/opal/opal/rspec.rb CHANGED
@@ -1,10 +1,32 @@
1
+ class MiniTest
2
+ class Unit; end
3
+ end
4
+
5
+ Test = MiniTest
6
+
1
7
  require 'file'
2
- require 'dir'
8
+ require 'corelib/dir'
3
9
  require 'thread'
4
10
 
11
+ require 'set'
12
+ require 'time'
13
+ require 'rbconfig'
14
+ require 'pathname'
15
+
5
16
  # vendor a pre-built rspec
6
17
  require 'opal/rspec/rspec'
7
18
 
19
+ # we "fix" these files, so require them now so they are loaded before our
20
+ # fixes file. We can't use Kernel#require() directly as the compiler will
21
+ # complain it can't find these files at compile time, but they are available
22
+ # from rspec.js from the gem.
23
+ %w[rspec
24
+ rspec/core/formatters/base_text_formatter
25
+ rspec/core/formatters/html_printer
26
+ rspec/matchers/pretty
27
+ rspec/matchers/built_in/base_matcher
28
+ rspec/matchers/built_in/be].each { |r| `self.$require(r)` }
29
+
8
30
  require 'opal/rspec/fixes'
9
31
  require 'opal/rspec/text_formatter'
10
32
  require 'opal/rspec/browser_formatter'
@@ -27,14 +27,18 @@ module RSpec::Expectations
27
27
  end
28
28
 
29
29
  # Opal does not support mutable strings
30
- module RSpec::Matchers::Pretty
31
- def underscore(camel_cased_word)
32
- word = camel_cased_word.to_s.dup
33
- word = word.gsub(/([A-Z]+)([A-Z][a-z])/,'$1_$2')
34
- word = word.gsub(/([a-z\d])([A-Z])/,'$1_$2')
35
- word = word.tr("-", "_")
36
- word = word.downcase
37
- word
30
+ module RSpec
31
+ module Matchers
32
+ module Pretty
33
+ def underscore(camel_cased_word)
34
+ word = camel_cased_word.to_s.dup
35
+ word = word.gsub(/([A-Z]+)([A-Z][a-z])/,'$1_$2')
36
+ word = word.gsub(/([a-z\d])([A-Z])/,'$1_$2')
37
+ word = word.tr("-", "_")
38
+ word = word.downcase
39
+ word
40
+ end
41
+ end
38
42
  end
39
43
  end
40
44
 
@@ -1,11 +1,11 @@
1
1
  # This file is used by Opal::Server to basically load all spec files that
2
2
  # can be found in the spec/ directory.
3
3
 
4
- <% require_asset 'opal' %>
5
- <% require_asset 'opal-rspec' %>
4
+ require 'opal'
5
+ require 'opal-rspec'
6
6
 
7
7
  <% Dir.glob('spec/**/*_spec.{rb,opal}').each do |s| %>
8
- <% require_asset s.sub(/^spec\//, '').sub(/\.(rb|opal)$/, '') %>
8
+ require <%= s.sub(/^spec\//, '').sub(/\.(rb|opal)$/, '').inspect %>
9
9
  <% end %>
10
10
 
11
11
  Opal::RSpec::Runner.autorun
metadata CHANGED
@@ -1,47 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.beta3
4
+ version: 0.4.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Beynon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-24 00:00:00.000000000 Z
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.0
20
- - - <
21
- - !ruby/object:Gem::Version
22
- version: 1.0.0
19
+ version: 0.7.0.dev
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - '>='
28
- - !ruby/object:Gem::Version
29
- version: 0.6.0
30
- - - <
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: 1.0.0
26
+ version: 0.7.0.dev
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: rake
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - '>='
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
33
  version: '0'
40
34
  type: :development
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - '>='
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: '0'
47
41
  description: Opal compatible rspec library
@@ -50,12 +44,11 @@ executables: []
50
44
  extensions: []
51
45
  extra_rdoc_files: []
52
46
  files:
53
- - .gitignore
47
+ - ".gitignore"
54
48
  - CHANGELOG.md
55
49
  - Gemfile
56
50
  - README.md
57
51
  - Rakefile
58
- - app/rspec-builder.rb
59
52
  - config.ru
60
53
  - example/Gemfile
61
54
  - example/README.md
@@ -72,6 +65,7 @@ files:
72
65
  - opal/opal/rspec/async.rb
73
66
  - opal/opal/rspec/browser_formatter.rb
74
67
  - opal/opal/rspec/fixes.rb
68
+ - opal/opal/rspec/rspec.js
75
69
  - opal/opal/rspec/runner.rb
76
70
  - opal/opal/rspec/sprockets_runner.rb.erb
77
71
  - opal/opal/rspec/text_formatter.rb
@@ -80,7 +74,6 @@ files:
80
74
  - spec/matchers_spec.rb
81
75
  - spec/mock_spec.rb
82
76
  - vendor/spec_runner.js
83
- - opal/opal/rspec/rspec.js
84
77
  homepage: http://opalrb.org
85
78
  licenses: []
86
79
  metadata: {}
@@ -90,18 +83,19 @@ require_paths:
90
83
  - lib
91
84
  required_ruby_version: !ruby/object:Gem::Requirement
92
85
  requirements:
93
- - - '>='
86
+ - - ">="
94
87
  - !ruby/object:Gem::Version
95
88
  version: '0'
96
89
  required_rubygems_version: !ruby/object:Gem::Requirement
97
90
  requirements:
98
- - - '>'
91
+ - - ">"
99
92
  - !ruby/object:Gem::Version
100
93
  version: 1.3.1
101
94
  requirements: []
102
95
  rubyforge_project:
103
- rubygems_version: 2.0.3
96
+ rubygems_version: 2.2.2
104
97
  signing_key:
105
98
  specification_version: 4
106
99
  summary: RSpec for Opal
107
100
  test_files: []
101
+ has_rdoc:
data/app/rspec-builder.rb DELETED
@@ -1,44 +0,0 @@
1
- require 'set'
2
- require 'time'
3
- require 'rbconfig'
4
-
5
- require 'rspec/support'
6
-
7
- require 'rspec/core/version'
8
-
9
- require 'rspec/support/caller_filter'
10
-
11
- require 'rspec/core/flat_map'
12
- require 'rspec/core/filter_manager'
13
- require 'rspec/core/dsl'
14
- require 'rspec/core/warnings'
15
- require 'rspec/core/reporter'
16
-
17
- require 'rspec/core/hooks'
18
- require 'rspec/core/memoized_helpers'
19
- require 'rspec/core/metadata'
20
- require 'rspec/core/pending'
21
- require 'rspec/core/formatters'
22
- require 'rspec/core/ordering'
23
-
24
- require 'rspec/core/world'
25
- require 'rspec/core/configuration'
26
- require 'rspec/core/option_parser'
27
- require 'rspec/core/configuration_options'
28
- require 'rspec/core/command_line'
29
- require 'rspec/core/runner'
30
- require 'rspec/core/example'
31
- require 'rspec/core/shared_example_group/collection'
32
- require 'rspec/core/shared_example_group'
33
- require 'rspec/core/example_group'
34
-
35
- require 'rspec/core'
36
- require 'rspec-expectations'
37
- require 'rspec/mocks'
38
-
39
- # we want access to BaseFormatter
40
- require 'rspec/core/formatters/base_formatter'
41
- require 'rspec/core/formatters/html_printer'
42
-
43
- # For now, we don't support mocking. This placeholder in rspec-core allows that.
44
- require 'rspec/core/mocking/with_rspec'