-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 58d10ea.
- v1.1.0.alpha3
- v1.1.0.alpha2
- v1.1.0.alpha1
- v1.0.0
- v1.0.0.alpha1
- v0.8.0
- v0.8.0.alpha3
- v0.8.0.alpha2
- v0.8.0.alpha1
- v0.7.1
- v0.7.0
- v0.7.0.rc.2
- v0.7.0.rc.1
- v0.6.2
- v0.6.1
- v0.6.0
- v0.6.0.beta1
- v0.5.0
- v0.5.0.beta3
- v0.5.0.beta2
- v0.5.0.beta1
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.4.0.beta4
- v0.4.0.beta3
- v0.4.0.beta2
- v0.3.0.beta3
1 parent
58d10ea
commit 8751f72
Showing
5 changed files
with
31 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,6 @@ | ||
require 'opal' | ||
require 'opal/rspec/version' | ||
|
||
module Opal | ||
module RSpec | ||
extend self | ||
|
||
def base_dir | ||
File.expand_path('../../..', __FILE__) | ||
end | ||
|
||
def build_rspec_js force = false | ||
path = File.expand_path('../../../opal/opal/rspec/rspec.js', __FILE__) | ||
puts "Building: #{path}..." | ||
return if File.exist? path and not(force) | ||
File.open(path, 'w+') { |out| out << rspec_js_code } | ||
end | ||
|
||
def rspec_js_code | ||
previous_severity = Opal::Processor.dynamic_require_severity | ||
Opal::Processor.dynamic_require_severity = :warning | ||
Opal.append_path File.join(base_dir, 'app') | ||
|
||
Opal.use_gem 'rspec' | ||
Opal.use_gem 'rspec-expectations' | ||
|
||
%w[time fileutils test/unit/assertions coderay optparse shellwords socket uri | ||
drb/drb diff/lcs diff/lcs/hunk].each do |asset| | ||
Opal::Processor.stub_file asset | ||
end | ||
|
||
# bug in rspec? this autoload doesnt exist so we must stub it | ||
Opal::Processor.stub_file 'rspec/matchers/built_in/have' | ||
|
||
Opal.process('rspec-builder').tap do | ||
Opal::Processor.dynamic_require_severity = previous_severity | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Just register our opal code path with opal build tools | ||
Opal.append_path File.join(Opal::RSpec.base_dir, 'opal') | ||
Opal.append_path File.expand_path('../../../opal', __FILE__) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters