opal 0.3.28 → 0.3.29
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.
- data/Gemfile +1 -1
- data/core/class.rb +4 -0
- data/core/kernel.rb +1 -1
- data/lib/opal/version.rb +1 -1
- data/spec/core/class/extend_spec.rb +47 -0
- metadata +4 -2
data/Gemfile
CHANGED
data/core/class.rb
CHANGED
data/core/kernel.rb
CHANGED
data/lib/opal/version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
module ClassExtendSpecs
|
2
|
+
module M1
|
3
|
+
def foo
|
4
|
+
:class_foo
|
5
|
+
end
|
6
|
+
|
7
|
+
def bar
|
8
|
+
:class_bar
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class C1
|
13
|
+
extend M1
|
14
|
+
end
|
15
|
+
|
16
|
+
class C2 < C1
|
17
|
+
end
|
18
|
+
|
19
|
+
class C3 < C1
|
20
|
+
end
|
21
|
+
|
22
|
+
class C4 < C3
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "Class#extend" do
|
27
|
+
it "class should get module methods added as class methods" do
|
28
|
+
ClassExtendSpecs::C1.foo.should == :class_foo
|
29
|
+
ClassExtendSpecs::C1.bar.should == :class_bar
|
30
|
+
end
|
31
|
+
|
32
|
+
it "class should add included methods to its .methods array" do
|
33
|
+
ClassExtendSpecs::C1.methods.include?(:foo).should be_true
|
34
|
+
ClassExtendSpecs::C1.methods.include?(:bar).should be_true
|
35
|
+
end
|
36
|
+
|
37
|
+
it "subclasses should have methods defined from superclass" do
|
38
|
+
ClassExtendSpecs::C2.foo.should == :class_foo
|
39
|
+
ClassExtendSpecs::C2.bar.should == :class_bar
|
40
|
+
|
41
|
+
ClassExtendSpecs::C3.foo.should == :class_foo
|
42
|
+
ClassExtendSpecs::C3.bar.should == :class_bar
|
43
|
+
|
44
|
+
ClassExtendSpecs::C4.foo.should == :class_foo
|
45
|
+
ClassExtendSpecs::C4.bar.should == :class_bar
|
46
|
+
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.29
|
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-
|
12
|
+
date: 2012-10-28 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Ruby runtime and core library for javascript.
|
15
15
|
email: adam.beynon@gmail.com
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- spec/core/boolean/to_s_spec.rb
|
129
129
|
- spec/core/boolean/xor_spec.rb
|
130
130
|
- spec/core/class/bridge_class_spec.rb
|
131
|
+
- spec/core/class/extend_spec.rb
|
131
132
|
- spec/core/class/fixtures/classes.rb
|
132
133
|
- spec/core/class/instance_methods_spec.rb
|
133
134
|
- spec/core/class/last_value_spec.rb
|
@@ -507,6 +508,7 @@ test_files:
|
|
507
508
|
- spec/core/boolean/to_s_spec.rb
|
508
509
|
- spec/core/boolean/xor_spec.rb
|
509
510
|
- spec/core/class/bridge_class_spec.rb
|
511
|
+
- spec/core/class/extend_spec.rb
|
510
512
|
- spec/core/class/fixtures/classes.rb
|
511
513
|
- spec/core/class/instance_methods_spec.rb
|
512
514
|
- spec/core/class/last_value_spec.rb
|