babascript 0.2.4 → 0.2.5

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: 3daa35e5e0a729cf767fc93dbc4cc8227210a54b
4
- data.tar.gz: c74a70b6f51b99a285eb2c18b82c9efe213047bd
3
+ metadata.gz: 3aeb3ba4411427fee529dcbb7fbe34688dad3a57
4
+ data.tar.gz: 5ece4327e81b3dee667120289c5a7fc06977d143
5
5
  SHA512:
6
- metadata.gz: adcdd149c8f92f992c8aeb4d95e4d5be7b20d7442c9c4169afa185de18bd90a4e387cac8c5c4dc1d8f14a7ea1881852a57e30f8079ce576db6a574f0f028a87d
7
- data.tar.gz: 7f08115c3d974c2982153ac58b1d03f76e5f3c719e61de1b48728a3e7fe71cf44af446fed06bd927ffb10a667c2f636dc7f680aec76971ad00aa9ce916bfc05f
6
+ metadata.gz: 9422869567d055c38a22a3c09759bf082ee94c41a99fe57d77791f4edd54cd84c5d08d9e83af6fd2657462711d668a62513e8211e12b21771db7673ab0f3828c
7
+ data.tar.gz: 7989e74cba67c6fb8ff5f27c345e085b03cb6ac58eb85a7cb55eb9d2b5910d240fce031c318cfd2899ae6ebd8f0a2c206209c4b1f5104b982b144204d271e6c3
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.5 2013-08-08
2
+
3
+ * add test
4
+
1
5
  === 0.2.4 2013-08-07
2
6
 
3
7
  * not stop EventMachine if it's already running.
data/README.md CHANGED
@@ -59,6 +59,14 @@ BabaScriptはジョブ通知に[Linda](https://gihtub.com/shokai/linda-base)を
59
59
  環境変数BABAを"shokai"に切り替えると、以後のジョブの通知先が http://linda.masuilab.org/shokai/notifications になります。
60
60
 
61
61
 
62
+ Test
63
+ ----
64
+
65
+ % gem install bundler
66
+ % bundle install
67
+ % bundle exec rake test
68
+
69
+
62
70
  Contributing
63
71
  ------------
64
72
  1. Fork it
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.pattern = "test/test_*.rb"
6
+ end
7
+
8
+ task :default => :test
data/babascript.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "minitest"
27
28
  end
@@ -1,3 +1,3 @@
1
1
  module BabaScript
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -0,0 +1,41 @@
1
+ # -*- coding: utf-8 -*-
2
+ require File.expand_path 'test_helper', File.dirname(__FILE__)
3
+
4
+ class TestBabaScript < MiniTest::Test
5
+
6
+ ENV["BABA"] = "test"
7
+
8
+ def test_eval_write_tuple
9
+ tuple_ = nil
10
+ res_ = nil
11
+ EM::run do
12
+ linda = EM::RocketIO::Linda::Client.new BabaScript.LINDA_BASE
13
+ ts = linda.tuplespace[ BabaScript.LINDA_SPACE ]
14
+ linda.io.once :connect do
15
+ ts.take [:babascript, :eval] do |tuple|
16
+ tuple_ = tuple
17
+ ts.write [:babascript, :return, tuple[4]["callback"], "ざんまい"]
18
+ EM::add_timer 1 do
19
+ EM::stop
20
+ end
21
+ end
22
+ end
23
+
24
+ BabaScript.baba do
25
+ res_ = テスト 1, 2, "かずすけ"
26
+ end
27
+ end
28
+
29
+ assert_equal tuple_.class, Array
30
+ assert_equal tuple_.size, 5
31
+ assert_equal tuple_[0], "babascript"
32
+ assert_equal tuple_[1], "eval"
33
+ assert_equal tuple_[2], "テスト"
34
+ assert_equal tuple_[3], [1, 2, "かずすけ"]
35
+ assert_equal tuple_[4].class, Hash
36
+ assert tuple_[4].has_key? "callback"
37
+
38
+ assert_equal res_, "ざんまい"
39
+ end
40
+
41
+ end
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'minitest/autorun'
3
+
4
+ $:.unshift File.expand_path '../lib', File.dirname(__FILE__)
5
+ require 'babascript'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babascript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: minitest
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
84
98
  description: BabaScript is a script launguage which runs on @takumibaba
85
99
  email:
86
100
  - hashimoto@shokai.org
@@ -109,6 +123,8 @@ files:
109
123
  - samples/sample.bb
110
124
  - samples/sample.rb
111
125
  - samples/sample_arduino.rb
126
+ - test/test_babascript.rb
127
+ - test/test_helper.rb
112
128
  homepage: https://github.com/masuilab/babascript
113
129
  licenses:
114
130
  - MIT
@@ -133,4 +149,6 @@ rubygems_version: 2.0.5
133
149
  signing_key:
134
150
  specification_version: 4
135
151
  summary: BabaScript is a script launguage which runs on @takumibaba
136
- test_files: []
152
+ test_files:
153
+ - test/test_babascript.rb
154
+ - test/test_helper.rb