opal-rspec 0.4.0.beta4 → 0.4.0
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.
- checksums.yaml +4 -4
- data/Gemfile +5 -7
- data/README.md +2 -0
- data/lib/opal/rspec/version.rb +1 -1
- data/opal-rspec.gemspec +1 -1
- data/opal/opal/rspec/fixes.rb +4 -32
- data/spec/example_spec.rb +10 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e46408c770b69f808a37b68ba95e7772bcf2f02
|
4
|
+
data.tar.gz: 62e577d34d96408f9a73a6c2545c0e97cc9943a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e84f3bd88a92a3ec3ce35944615b4e4fcfd5c43f3b25033a0f0db92e5287dc1219d489ed5f77bd6bb5920b802ffa96b0c3f86b6e61e017b5bf6abddfb5dfeca
|
7
|
+
data.tar.gz: 944341e9395e507b981e71b3237e35bb19ad929b17c5cade5344daff617138104ff11dc6a90511a4bbca44517a5f07ead44ca2fccbfb0ab9e0ec585639de3e1b
|
data/Gemfile
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
gem '
|
5
|
-
|
6
|
-
gem 'rspec',
|
7
|
-
gem 'rspec-
|
8
|
-
gem 'rspec-
|
9
|
-
gem 'rspec-mocks', :path => 'rspec-mocks'
|
10
|
-
gem 'rspec-expectations', :path => 'rspec-expectations'
|
4
|
+
gem 'rspec', path: 'rspec'
|
5
|
+
gem 'rspec-support', path: 'rspec-support'
|
6
|
+
gem 'rspec-core', path: 'rspec-core'
|
7
|
+
gem 'rspec-mocks', path: 'rspec-mocks'
|
8
|
+
gem 'rspec-expectations', path: 'rspec-expectations'
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# opal-rspec
|
2
2
|
|
3
|
+
[](http://travis-ci.org/opal/opal-rspec)
|
4
|
+
|
3
5
|
An attempt at a compatibility layer of rspec for opal.
|
4
6
|
|
5
7
|
[See the website for documentation](http://opalrb.org/docs/rspec/).
|
data/lib/opal/rspec/version.rb
CHANGED
data/opal-rspec.gemspec
CHANGED
data/opal/opal/rspec/fixes.rb
CHANGED
@@ -1,19 +1,3 @@
|
|
1
|
-
# IO.closed? missing - BaseFormatter uses it for sync impl
|
2
|
-
class IO
|
3
|
-
def closed?
|
4
|
-
false
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
# Opal defines enumerable#flat_map, but doesnt implement it
|
9
|
-
module RSpec::Core::FlatMap
|
10
|
-
def flat_map(array)
|
11
|
-
array.map { |item| yield item }.flatten
|
12
|
-
end
|
13
|
-
|
14
|
-
module_function :flat_map
|
15
|
-
end
|
16
|
-
|
17
1
|
# This breaks on 2.0.0, so it is here ready for when opal bumps to 2.0.0
|
18
2
|
class RSpec::CallerFilter
|
19
3
|
def self.first_non_rspec_line
|
@@ -21,26 +5,14 @@ class RSpec::CallerFilter
|
|
21
5
|
end
|
22
6
|
end
|
23
7
|
|
24
|
-
# String#<< is not supported by Opal
|
25
|
-
module RSpec::Expectations
|
26
|
-
def self.fail_with(message, expected = nil, actual = nil)
|
27
|
-
if !message
|
28
|
-
raise ArgumentError, "Failure message is nil. Does your matcher define the " +
|
29
|
-
"appropriate failure_message_for_* method to return a string?"
|
30
|
-
end
|
31
|
-
|
32
|
-
raise RSpec::Expectations::ExpectationNotMetError.new(message)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
8
|
# Opal does not support mutable strings
|
37
9
|
module RSpec
|
38
10
|
module Matchers
|
39
11
|
module Pretty
|
40
12
|
def underscore(camel_cased_word)
|
41
|
-
word = camel_cased_word.to_s
|
42
|
-
word = word.gsub(/([A-Z]+)([A-Z][a-z])/,'
|
43
|
-
word = word.gsub(/([a-z\d])([A-Z])/,'
|
13
|
+
word = camel_cased_word.to_s
|
14
|
+
word = word.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
15
|
+
word = word.gsub(/([a-z\d])([A-Z])/,'\1_\2')
|
44
16
|
word = word.tr("-", "_")
|
45
17
|
word = word.downcase
|
46
18
|
word
|
@@ -63,7 +35,7 @@ module RSpec::ExampleGroups
|
|
63
35
|
|
64
36
|
# Ruby requires first const letter to be A-Z. Use `Nested`
|
65
37
|
# as necessary to enforce that.
|
66
|
-
name = name.gsub(/^([^A-Z]|$)/, 'Nested
|
38
|
+
name = name.gsub(/^([^A-Z]|$)/, 'Nested\1')
|
67
39
|
|
68
40
|
name
|
69
41
|
end
|
data/spec/example_spec.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.0
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Beynon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-02 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.7.0
|
19
|
+
version: 0.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.7.0
|
26
|
+
version: 0.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -246,9 +246,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
246
246
|
version: '0'
|
247
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
248
248
|
requirements:
|
249
|
-
- - "
|
249
|
+
- - ">="
|
250
250
|
- !ruby/object:Gem::Version
|
251
|
-
version:
|
251
|
+
version: '0'
|
252
252
|
requirements: []
|
253
253
|
rubyforge_project:
|
254
254
|
rubygems_version: 2.4.3
|