flok 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,68 +0,0 @@
1
- #require './lib/flok.rb'
2
- #require 'tempfile'
3
- #require 'securerandom'
4
- #require 'v8'
5
-
6
- #def ensure_tmp
7
- #tmp_spec_path = './spec/tmp'
8
- #Dir.mkdir(tmp_spec_path) unless File.exists?(tmp_spec_path)
9
- #end
10
-
11
- #RSpec.describe "Flok::MergeSourceSpec" do
12
- #it "when merging the kernel, it returns a string" do
13
- #str = Flok::MergeSource.merge_kernel
14
- #expect(str.class).to be(String)
15
- #end
16
-
17
- #it "when merging the kernel, it returns a string with length" do
18
- #str = Flok::MergeSource.merge_kernel
19
- #expect(str.length).to be > 0
20
- #end
21
-
22
- #it "when merging the kernel, the kernel files located in ./lib/js/kernel/ do merge and run without js syntax errors" do
23
- #str = Flok::MergeSource.merge_kernel
24
- #ctx = V8::Context.new
25
- #ctx.eval(str)
26
-
27
- ##It does not throw an error
28
- #end
29
-
30
- #it "merges the user generated source files from app/*.js" do
31
- ##Get a temporary file, delete it, but save the path
32
- #temp = Tempfile.new "flok-temp"
33
- #path = temp.path
34
- #temp.close
35
- #temp.unlink
36
-
37
- ##Create a new project
38
- #`ruby -Ilib ./bin/flok new #{path}`
39
-
40
- ##Add a source function to this project
41
- #main_js = %{
42
- #function call_me_maybe() {
43
- #return call_me_maybe_response;
44
- #}
45
- #}
46
-
47
- #two_js = %{
48
- #var call_me_maybe_response = "no_way";
49
- #}
50
-
51
- #File.write "#{path}/app/main.js", main_js
52
- #File.write "#{path}/app/two.js", two_js
53
-
54
- ##Build
55
- #rpath = Dir.pwd
56
- #Dir.chdir path do
57
- #`ruby -I#{rpath}/lib #{rpath}/bin/flok build`
58
-
59
- ##Execute
60
- #Dir.chdir './public' do
61
- #ctx = V8::Context.new
62
- #ctx.load "application.js"
63
- #res = ctx.eval("call_me_maybe()")
64
- #expect(res).to eq("no_way")
65
- #end
66
- #end
67
- #end
68
- #end
data/ypou DELETED
File without changes