pione 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +94 -0
- data/Rakefile +118 -0
- data/bin/pione-broker +5 -0
- data/bin/pione-clean +5 -0
- data/bin/pione-client +5 -0
- data/bin/pione-eval +111 -0
- data/bin/pione-relay +5 -0
- data/bin/pione-relay-account-db +5 -0
- data/bin/pione-relay-client-db +5 -0
- data/bin/pione-search-log +30 -0
- data/bin/pione-syntax-checker +5 -0
- data/bin/pione-task-worker +5 -0
- data/bin/pione-tuple-space-provider +5 -0
- data/bin/pione-tuple-space-receiver +5 -0
- data/bin/pione-tuple-space-viewer +5 -0
- data/demo/demo.rb +311 -0
- data/demo/public/base.css +94 -0
- data/demo/public/demo.js +107 -0
- data/demo/public/index.html +91 -0
- data/demo/public/jquery-1.8.3.min.js +2 -0
- data/example/CountChar/CountChar.pione +64 -0
- data/example/CountChar/misc/CountChar.rb +22 -0
- data/example/CountChar/text/aidokushono_insho.txt +32 -0
- data/example/CountChar/text/aikokuka_shokan.txt +108 -0
- data/example/CountChar/text/carlyle_hakubutsukan.txt +58 -0
- data/example/CountChar/text/dark_minister.txt +2440 -0
- data/example/CountChar/text/kaikano_otto.txt +61 -0
- data/example/CountChar/text/kaikon.txt +30 -0
- data/example/CountChar/text/nagashimano_shi.txt +45 -0
- data/example/CountChar/text/saikachibuchi.txt +80 -0
- data/example/CountChar/text/saikonihonno_josei.txt +91 -0
- data/example/CountChar/text/taishojugonenno_bundan.txt +21 -0
- data/example/FeatureExample/FeatureExample.pione +7 -0
- data/example/Fib/Fib.pione +56 -0
- data/example/Fib/FibBC.pione +56 -0
- data/example/HelloWorld/HelloWorld.pione +5 -0
- data/example/LucasNumber/LucasNumber.pione +64 -0
- data/example/MakePair/MakePair.pione +14 -0
- data/example/MakePair/data/1.i +0 -0
- data/example/MakePair/data/2.i +0 -0
- data/example/MakePair/data/3.i +0 -0
- data/example/MakePair/data/4.i +0 -0
- data/example/MakePair/data/5.i +0 -0
- data/example/SieveOfEratosthenes/SieveOfEratosthenes.pione +61 -0
- data/example/SingleParticlesWithRef/Makefile +289 -0
- data/example/SingleParticlesWithRef/SingleParticlesWithRef.Makefile +153 -0
- data/example/SingleParticlesWithRef/SingleParticlesWithRef.pione +116 -0
- data/example/SingleParticlesWithRef/SingleParticlesWithRefFull.pione +400 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift.pdb +3381 -0
- data/example/SingleParticlesWithRef/data/all.ref2d +0 -0
- data/example/SingleParticlesWithRef/data/all.ref3d +0 -0
- data/example/Sum/Sum.pione +52 -0
- data/example/SyntaxError/call_rule_error.pione +6 -0
- data/example/SyntaxError/feature_line_error.pione +7 -0
- data/example/SyntaxError/flow_block_error.pione +5 -0
- data/example/SyntaxError/input_line_error.pione +6 -0
- data/example/SyntaxError/invalid_rule_name.pione +6 -0
- data/example/SyntaxError/param_line_error.pione +7 -0
- data/example/SyntaxError/variable-binding-error.pione +11 -0
- data/lib/pione.rb +241 -0
- data/lib/pione/agent/basic-agent.rb +333 -0
- data/lib/pione/agent/broker.rb +274 -0
- data/lib/pione/agent/command-listener.rb +47 -0
- data/lib/pione/agent/input-generator.rb +194 -0
- data/lib/pione/agent/logger.rb +65 -0
- data/lib/pione/agent/process-manager.rb +38 -0
- data/lib/pione/agent/rule-provider.rb +64 -0
- data/lib/pione/agent/task-worker.rb +274 -0
- data/lib/pione/agent/trivial-routine-worker.rb +28 -0
- data/lib/pione/agent/tuple-space-client.rb +146 -0
- data/lib/pione/agent/tuple-space-server-client-life-checker.rb +29 -0
- data/lib/pione/command-option/basic-option.rb +42 -0
- data/lib/pione/command-option/child-process-option.rb +17 -0
- data/lib/pione/command-option/common-option.rb +29 -0
- data/lib/pione/command-option/daemon-option.rb +12 -0
- data/lib/pione/command-option/presence-notifier-option.rb +15 -0
- data/lib/pione/command-option/task-worker-owner-option.rb +17 -0
- data/lib/pione/command-option/tuple-space-provider-option.rb +26 -0
- data/lib/pione/command-option/tuple-space-provider-owner-option.rb +16 -0
- data/lib/pione/command-option/tuple-space-receiver-option.rb +12 -0
- data/lib/pione/command/basic-command.rb +126 -0
- data/lib/pione/command/child-process.rb +43 -0
- data/lib/pione/command/daemon-process.rb +18 -0
- data/lib/pione/command/front-owner-command.rb +37 -0
- data/lib/pione/command/pione-broker.rb +53 -0
- data/lib/pione/command/pione-clean.rb +16 -0
- data/lib/pione/command/pione-client.rb +273 -0
- data/lib/pione/command/pione-relay-account-db.rb +85 -0
- data/lib/pione/command/pione-relay-client-db.rb +80 -0
- data/lib/pione/command/pione-relay.rb +47 -0
- data/lib/pione/command/pione-syntax-checker.rb +103 -0
- data/lib/pione/command/pione-task-worker.rb +123 -0
- data/lib/pione/command/pione-tuple-space-provider.rb +87 -0
- data/lib/pione/command/pione-tuple-space-receiver.rb +55 -0
- data/lib/pione/command/pione-tuple-space-viewer.rb +151 -0
- data/lib/pione/command/tuple-space-provider-owner.rb +6 -0
- data/lib/pione/front/basic-front.rb +64 -0
- data/lib/pione/front/broker-front.rb +30 -0
- data/lib/pione/front/client-front.rb +28 -0
- data/lib/pione/front/relay-front.rb +19 -0
- data/lib/pione/front/task-worker-front.rb +16 -0
- data/lib/pione/front/task-worker-owner.rb +42 -0
- data/lib/pione/front/tuple-space-provider-front.rb +22 -0
- data/lib/pione/front/tuple-space-provider-owner.rb +11 -0
- data/lib/pione/front/tuple-space-receiver-front.rb +18 -0
- data/lib/pione/model/assignment.rb +89 -0
- data/lib/pione/model/basic-model.rb +395 -0
- data/lib/pione/model/binary-operator.rb +80 -0
- data/lib/pione/model/block.rb +233 -0
- data/lib/pione/model/boolean.rb +138 -0
- data/lib/pione/model/call-rule.rb +69 -0
- data/lib/pione/model/data-expr.rb +360 -0
- data/lib/pione/model/feature-expr.rb +794 -0
- data/lib/pione/model/float.rb +107 -0
- data/lib/pione/model/integer.rb +140 -0
- data/lib/pione/model/list.rb +104 -0
- data/lib/pione/model/message.rb +80 -0
- data/lib/pione/model/package.rb +48 -0
- data/lib/pione/model/parameters.rb +282 -0
- data/lib/pione/model/rule-expr.rb +120 -0
- data/lib/pione/model/rule-io.rb +166 -0
- data/lib/pione/model/rule.rb +294 -0
- data/lib/pione/model/string.rb +111 -0
- data/lib/pione/model/undefined-value.rb +24 -0
- data/lib/pione/model/variable-table.rb +315 -0
- data/lib/pione/model/variable.rb +87 -0
- data/lib/pione/parser/block-parser.rb +83 -0
- data/lib/pione/parser/common-parser.rb +145 -0
- data/lib/pione/parser/document-parser.rb +58 -0
- data/lib/pione/parser/error-message.yml +4 -0
- data/lib/pione/parser/expr-parser.rb +266 -0
- data/lib/pione/parser/feature-expr-parser.rb +105 -0
- data/lib/pione/parser/flow-element-parser.rb +181 -0
- data/lib/pione/parser/literal-parser.rb +182 -0
- data/lib/pione/parser/rule-definition-parser.rb +163 -0
- data/lib/pione/parser/syntax-error.rb +61 -0
- data/lib/pione/patch/array-patch.rb +3 -0
- data/lib/pione/patch/drb-patch.rb +467 -0
- data/lib/pione/patch/monitor-patch.rb +16 -0
- data/lib/pione/patch/rinda-patch.rb +759 -0
- data/lib/pione/patch/uri-patch.rb +66 -0
- data/lib/pione/relay/receiver-socket.rb +69 -0
- data/lib/pione/relay/relay-account-db.rb +55 -0
- data/lib/pione/relay/relay-client-db.rb +53 -0
- data/lib/pione/relay/relay-socket.rb +215 -0
- data/lib/pione/relay/trampoline.rb +22 -0
- data/lib/pione/relay/transmitter-socket.rb +167 -0
- data/lib/pione/resource/basic-resource.rb +92 -0
- data/lib/pione/resource/dropbox-resource.rb +106 -0
- data/lib/pione/resource/ftp.rb +84 -0
- data/lib/pione/resource/local.rb +113 -0
- data/lib/pione/rule-handler/action-handler.rb +184 -0
- data/lib/pione/rule-handler/basic-handler.rb +217 -0
- data/lib/pione/rule-handler/flow-handler.rb +339 -0
- data/lib/pione/rule-handler/root-handler.rb +23 -0
- data/lib/pione/rule-handler/system-handler.rb +13 -0
- data/lib/pione/system/common.rb +22 -0
- data/lib/pione/system/config.rb +20 -0
- data/lib/pione/system/document.rb +81 -0
- data/lib/pione/system/file-cache.rb +150 -0
- data/lib/pione/system/global.rb +346 -0
- data/lib/pione/system/identifier.rb +61 -0
- data/lib/pione/system/init.rb +16 -0
- data/lib/pione/system/object.rb +35 -0
- data/lib/pione/transformer/block-transformer.rb +23 -0
- data/lib/pione/transformer/document-transformer.rb +36 -0
- data/lib/pione/transformer/expr-transformer.rb +89 -0
- data/lib/pione/transformer/feature-expr-transformer.rb +56 -0
- data/lib/pione/transformer/flow-element-transformer.rb +66 -0
- data/lib/pione/transformer/literal-transformer.rb +76 -0
- data/lib/pione/transformer/rule-definition-transformer.rb +62 -0
- data/lib/pione/transformer/transformer-module.rb +37 -0
- data/lib/pione/tuple-space/data-finder.rb +165 -0
- data/lib/pione/tuple-space/presence-notifier.rb +83 -0
- data/lib/pione/tuple-space/relay.rb +9 -0
- data/lib/pione/tuple-space/tuple-space-provider.rb +85 -0
- data/lib/pione/tuple-space/tuple-space-receiver.rb +140 -0
- data/lib/pione/tuple-space/tuple-space-server-interface.rb +60 -0
- data/lib/pione/tuple-space/tuple-space-server.rb +156 -0
- data/lib/pione/tuple-space/update-criteria.rb +96 -0
- data/lib/pione/tuple/agent-tuple.rb +10 -0
- data/lib/pione/tuple/attribute-tuple.rb +7 -0
- data/lib/pione/tuple/base-uri-tuple.rb +9 -0
- data/lib/pione/tuple/basic-tuple.rb +317 -0
- data/lib/pione/tuple/bye-tuple.rb +9 -0
- data/lib/pione/tuple/command-tuple.rb +9 -0
- data/lib/pione/tuple/data-tuple.rb +18 -0
- data/lib/pione/tuple/dry-run-tuple.rb +8 -0
- data/lib/pione/tuple/exception-tuple.rb +11 -0
- data/lib/pione/tuple/finished-tuple.rb +17 -0
- data/lib/pione/tuple/foreground-tuple.rb +7 -0
- data/lib/pione/tuple/log-tuple.rb +14 -0
- data/lib/pione/tuple/process-info-tuple.rb +9 -0
- data/lib/pione/tuple/request-rule-tuple.rb +9 -0
- data/lib/pione/tuple/rule-tuple.rb +10 -0
- data/lib/pione/tuple/shift-tuple.rb +13 -0
- data/lib/pione/tuple/task-tuple.rb +36 -0
- data/lib/pione/tuple/task-worker-resource-tuple.rb +9 -0
- data/lib/pione/tuple/working-tuple.rb +13 -0
- data/lib/pione/uri-scheme/basic-scheme.rb +40 -0
- data/lib/pione/uri-scheme/broadcast-scheme.rb +11 -0
- data/lib/pione/uri-scheme/dropbox-scheme.rb +9 -0
- data/lib/pione/uri-scheme/local-scheme.rb +28 -0
- data/lib/pione/util/error-report.rb +12 -0
- data/lib/pione/util/log.rb +79 -0
- data/lib/pione/util/message.rb +155 -0
- data/lib/pione/util/misc.rb +73 -0
- data/lib/pione/util/terminal.rb +78 -0
- data/lib/pione/util/waiter-table.rb +53 -0
- data/lib/pione/version.rb +3 -0
- data/misc/env.sh +2 -0
- data/misc/test-drb-stop-service.rb +34 -0
- data/misc/test-ensure-and-thread-kill.rb +40 -0
- data/misc/test-many-waiters-client.rb +56 -0
- data/misc/test-many-waiters-server.rb +14 -0
- data/misc/write_and_take_test.png +0 -0
- data/misc/write_and_take_test.rb +36 -0
- data/pione.gemspec +49 -0
- data/test/agent/spec_basic-agent.rb +170 -0
- data/test/agent/spec_broker.rb +36 -0
- data/test/agent/spec_command-listener.rb +30 -0
- data/test/agent/spec_input-generator.rb +123 -0
- data/test/agent/spec_logger.rb +71 -0
- data/test/agent/spec_rule-provider.rb +65 -0
- data/test/agent/spec_task-worker.rb +307 -0
- data/test/agent/spec_tuple-space-client.rb +30 -0
- data/test/model/spec_assignment.rb +51 -0
- data/test/model/spec_binary-operator.rb +39 -0
- data/test/model/spec_block.rb +154 -0
- data/test/model/spec_boolean.rb +115 -0
- data/test/model/spec_call-rule.rb +23 -0
- data/test/model/spec_data-expr.rb +312 -0
- data/test/model/spec_feature-expr.rb +359 -0
- data/test/model/spec_feature-expr.yml +16 -0
- data/test/model/spec_float.rb +141 -0
- data/test/model/spec_integer.rb +141 -0
- data/test/model/spec_list.rb +26 -0
- data/test/model/spec_message.rb +42 -0
- data/test/model/spec_package.rb +15 -0
- data/test/model/spec_parameters.rb +148 -0
- data/test/model/spec_rule-expr.rb +66 -0
- data/test/model/spec_rule-io.rb +32 -0
- data/test/model/spec_rule.rb +158 -0
- data/test/model/spec_string.rb +106 -0
- data/test/model/spec_variable-table.rb +117 -0
- data/test/model/spec_variable.rb +84 -0
- data/test/parser/spec_block-parser.rb +5 -0
- data/test/parser/spec_block-parser.yml +85 -0
- data/test/parser/spec_common-parser.rb +281 -0
- data/test/parser/spec_expr-parser.rb +6 -0
- data/test/parser/spec_expr-parser.yml +82 -0
- data/test/parser/spec_feature-expr-parser.rb +32 -0
- data/test/parser/spec_feature-expr-parser.yml +25 -0
- data/test/parser/spec_flow-element-parser.rb +5 -0
- data/test/parser/spec_flow-element-parser.yml +180 -0
- data/test/parser/spec_literal-parser.rb +5 -0
- data/test/parser/spec_literal-parser.yml +123 -0
- data/test/parser/spec_rule-definition-parser.rb +5 -0
- data/test/parser/spec_rule-definition-parser.yml +93 -0
- data/test/patch/spec_rinda-patch.rb +32 -0
- data/test/patch/spec_uri-patch.rb +23 -0
- data/test/rule-handler/spec_action-handler.rb +135 -0
- data/test/rule-handler/spec_flow-handler.rb +127 -0
- data/test/spec_common.rb +14 -0
- data/test/spec_data-finder.rb +88 -0
- data/test/spec_data-finder.yml +115 -0
- data/test/spec_document.rb +76 -0
- data/test/spec_identifier.rb +29 -0
- data/test/spec_log.rb +52 -0
- data/test/spec_object.rb +20 -0
- data/test/spec_resource.rb +73 -0
- data/test/spec_update-criteria.rb +83 -0
- data/test/test-util.rb +223 -0
- data/test/transformer/spec_block-transformer.rb +26 -0
- data/test/transformer/spec_expr-transformer.rb +106 -0
- data/test/transformer/spec_feature-expr-transformer.rb +21 -0
- data/test/transformer/spec_flow-element-transformer.rb +154 -0
- data/test/transformer/spec_literal-transformer.rb +58 -0
- data/test/transformer/spec_rule-definition-transformer.rb +168 -0
- data/test/tuple-space/spec_tuple-space-provider.rb +36 -0
- data/test/tuple-space/spec_tuple-space-receiver.rb +32 -0
- data/test/tuple-space/spec_tuple-space-server.rb +49 -0
- data/test/tuple/spec_basic-tuple.rb +87 -0
- data/test/tuple/spec_data-tuple.rb +85 -0
- data/test/tuple/spec_finished-tuple.rb +61 -0
- data/test/tuple/spec_task-tuple.rb +127 -0
- data/test/tuple/spec_working-tuple.rb +58 -0
- data/test/uri-scheme/spec_broadcast-scheme.rb +40 -0
- data/test/uri-scheme/spec_dropbox-scheme.rb +31 -0
- data/test/uri-scheme/spec_local-scheme.rb +69 -0
- metadata +660 -0
@@ -0,0 +1,359 @@
|
|
1
|
+
require_relative '../test-util'
|
2
|
+
|
3
|
+
describe 'Feature::Expr' do
|
4
|
+
it 'should equal' do
|
5
|
+
Feature::PossibleExpr.new("A").should ==
|
6
|
+
Feature::PossibleExpr.new("A")
|
7
|
+
Feature::RestrictiveExpr.new("A").should ==
|
8
|
+
Feature::RestrictiveExpr.new("A")
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should not equal' do
|
12
|
+
possible_a = Feature::PossibleExpr.new("A")
|
13
|
+
possible_b = Feature::PossibleExpr.new("B")
|
14
|
+
restrictive_a = Feature::RestrictiveExpr.new("A")
|
15
|
+
restrictive_b = Feature::RestrictiveExpr.new("B")
|
16
|
+
requisite_a = Feature::RequisiteExpr.new("A")
|
17
|
+
requisite_b = Feature::RequisiteExpr.new("B")
|
18
|
+
blocking_a = Feature::BlockingExpr.new("A")
|
19
|
+
blocking_b = Feature::BlockingExpr.new("B")
|
20
|
+
preferred_a = Feature::PreferredExpr.new("A")
|
21
|
+
preferred_b = Feature::PreferredExpr.new("B")
|
22
|
+
empty = Feature::EmptyFeature.new
|
23
|
+
boundless = Feature::BoundlessFeature.new
|
24
|
+
possible_a.should.not == possible_b
|
25
|
+
possible_a.should.not == restrictive_a
|
26
|
+
possible_a.should.not == requisite_a
|
27
|
+
possible_a.should.not == blocking_a
|
28
|
+
possible_a.should.not == preferred_a
|
29
|
+
possible_a.should.not == empty
|
30
|
+
possible_a.should.not == boundless
|
31
|
+
restrictive_a.should.not == restrictive_b
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should match' do
|
35
|
+
possible = Feature::PossibleExpr.new("A")
|
36
|
+
requisite = Feature::RequisiteExpr.new("A")
|
37
|
+
possible.match(requisite).should.true
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should not match' do
|
41
|
+
possible = Feature::PossibleExpr.new("A")
|
42
|
+
requisite = Feature::RequisiteExpr.new("B")
|
43
|
+
requisite.match(possible).should.false
|
44
|
+
end
|
45
|
+
|
46
|
+
describe 'Feature::EmptyFeature' do
|
47
|
+
it 'should be equal' do
|
48
|
+
Feature.empty.should == Feature.empty
|
49
|
+
Feature.empty.should == Feature.and()
|
50
|
+
Feature.empty.should == Feature.or()
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'Feature::AndExpr' do
|
55
|
+
it 'should be equal' do
|
56
|
+
Feature.and().should == Feature.empty
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should be empty' do
|
60
|
+
Feature.and.should.be.empty
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should add elements' do
|
64
|
+
a = Feature::PossibleExpr.new("A")
|
65
|
+
b = Feature::PossibleExpr.new("B")
|
66
|
+
c = Feature::PossibleExpr.new("C")
|
67
|
+
d = Feature::PossibleExpr.new("D")
|
68
|
+
and1 = Feature::AndExpr.new(a, b)
|
69
|
+
Feature::AndExpr.new(and1, c, d).should ==
|
70
|
+
Feature::AndExpr.new(a, b, c, d)
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'should unify redundant elements' do
|
74
|
+
a = Feature::PossibleExpr.new("A")
|
75
|
+
b = Feature::PossibleExpr.new("B")
|
76
|
+
and1 = Feature::AndExpr.new(a, b)
|
77
|
+
Feature::AndExpr.new(and1, a, b).should == and1
|
78
|
+
Feature::AndExpr.new(and1, and1).should == and1
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'should background preferred feature by requisite feature' do
|
82
|
+
requisite = Feature::RequisiteExpr.new("A")
|
83
|
+
preferred = Feature::PreferredExpr.new("A")
|
84
|
+
Feature::AndExpr.new(requisite, preferred).simplify.should ==
|
85
|
+
requisite
|
86
|
+
Feature::AndExpr.new(preferred, requisite).simplify.should ==
|
87
|
+
requisite
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should background preferred feature by blocking feature' do
|
91
|
+
blocking = Feature::BlockingExpr.new("A")
|
92
|
+
preferred = Feature::PreferredExpr.new("A")
|
93
|
+
Feature::AndExpr.new(blocking, preferred).simplify.should ==
|
94
|
+
blocking
|
95
|
+
Feature::AndExpr.new(preferred, blocking).simplify.should ==
|
96
|
+
blocking
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'should summarize or-clause' do
|
100
|
+
a = Feature::PossibleExpr.new("A")
|
101
|
+
b = Feature::PossibleExpr.new("B")
|
102
|
+
c = Feature::PossibleExpr.new("C")
|
103
|
+
d = Feature::PossibleExpr.new("D")
|
104
|
+
or1 = Feature::OrExpr.new(a, b)
|
105
|
+
or2 = Feature::OrExpr.new(a, c)
|
106
|
+
or3 = Feature::OrExpr.new(a, d)
|
107
|
+
or4 = Feature::OrExpr.new(c, d)
|
108
|
+
Feature::AndExpr.new(or1, or2).simplify.should ==
|
109
|
+
Feature::OrExpr.new(a, Feature::AndExpr.new(b, c))
|
110
|
+
Feature::AndExpr.new(or2, or1).simplify.should ==
|
111
|
+
Feature::OrExpr.new(a, Feature::AndExpr.new(b, c))
|
112
|
+
Feature::AndExpr.new(or1, or2, or3).simplify.should ==
|
113
|
+
Feature::OrExpr.new(a, Feature::AndExpr.new(b, c, d))
|
114
|
+
Feature::AndExpr.new(or1, or2, or4).simplify.should ==
|
115
|
+
Feature::AndExpr.new(Feature::OrExpr.new(a, Feature::AndExpr.new(b, c)),
|
116
|
+
Feature::OrExpr.new(c, d))
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'should unify by restrictive feature' do
|
120
|
+
possible = Feature::PossibleExpr.new("A")
|
121
|
+
restrictive = Feature::RestrictiveExpr.new("A")
|
122
|
+
Feature::AndExpr.new(possible, restrictive).simplify.should ==
|
123
|
+
restrictive
|
124
|
+
Feature::AndExpr.new(restrictive, possible).simplify.should ==
|
125
|
+
restrictive
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'should expand' do
|
129
|
+
a = Feature::PossibleExpr.new("A")
|
130
|
+
b = Feature::PossibleExpr.new("B")
|
131
|
+
c = Feature::PossibleExpr.new("C")
|
132
|
+
d = Feature::PossibleExpr.new("D")
|
133
|
+
or1 = Feature::OrExpr.new(a, b)
|
134
|
+
or2 = Feature::OrExpr.new(c, d)
|
135
|
+
list = Feature::AndExpr.new(or1, or2).expander.to_a
|
136
|
+
list.size.should == 4
|
137
|
+
list.should.include Feature::AndExpr.new(a, c)
|
138
|
+
list.should.include Feature::AndExpr.new(a, d)
|
139
|
+
list.should.include Feature::AndExpr.new(b, c)
|
140
|
+
list.should.include Feature::AndExpr.new(b, d)
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'should clone with the set' do
|
144
|
+
a = Feature::PossibleExpr.new("A")
|
145
|
+
b = Feature::PossibleExpr.new("B")
|
146
|
+
expr = Feature::AndExpr.new(a, b)
|
147
|
+
expr.clone.should == expr
|
148
|
+
expr.clone.__id__.should.not == expr.__id__
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
describe 'Feature::OrExpr' do
|
153
|
+
it 'should add elements' do
|
154
|
+
a = Feature::PossibleExpr.new("A")
|
155
|
+
b = Feature::PossibleExpr.new("B")
|
156
|
+
c = Feature::PossibleExpr.new("C")
|
157
|
+
d = Feature::PossibleExpr.new("D")
|
158
|
+
expr = Feature::OrExpr.new(a, b)
|
159
|
+
Feature::OrExpr.new(expr, c, d).should ==
|
160
|
+
Feature::OrExpr.new(a, b, c, d)
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'should unify redundant elements' do
|
164
|
+
a = Feature::PossibleExpr.new("A")
|
165
|
+
b = Feature::PossibleExpr.new("B")
|
166
|
+
expr = Feature::OrExpr.new(a, b)
|
167
|
+
Feature::OrExpr.new(expr, a, b).should == expr
|
168
|
+
Feature::OrExpr.new(expr, expr).should == expr
|
169
|
+
end
|
170
|
+
|
171
|
+
it 'should foreground preferred feature over requisite feature' do
|
172
|
+
requisite = Feature::RequisiteExpr.new("A")
|
173
|
+
preferred = Feature::PreferredExpr.new("A")
|
174
|
+
Feature::OrExpr.new(requisite, preferred).simplify.should ==
|
175
|
+
preferred
|
176
|
+
Feature::OrExpr.new(preferred, requisite).simplify.should ==
|
177
|
+
preferred
|
178
|
+
end
|
179
|
+
|
180
|
+
it 'should foreground preferred feature over blocking feature' do
|
181
|
+
blocking = Feature::BlockingExpr.new("A")
|
182
|
+
preferred = Feature::PreferredExpr.new("A")
|
183
|
+
Feature::OrExpr.new(blocking, preferred).simplify.should ==
|
184
|
+
preferred
|
185
|
+
Feature::OrExpr.new(preferred, blocking).simplify.should ==
|
186
|
+
preferred
|
187
|
+
end
|
188
|
+
|
189
|
+
it 'should unify by possible feature' do
|
190
|
+
possible = Feature::PossibleExpr.new("A")
|
191
|
+
restrictive = Feature::RestrictiveExpr.new("A")
|
192
|
+
Feature::OrExpr.new(possible, restrictive).simplify.should ==
|
193
|
+
possible
|
194
|
+
Feature::OrExpr.new(restrictive, possible).simplify.should ==
|
195
|
+
possible
|
196
|
+
end
|
197
|
+
|
198
|
+
it 'should neutralize' do
|
199
|
+
requisite = Feature::RequisiteExpr.new("A")
|
200
|
+
blocking = Feature::BlockingExpr.new("A")
|
201
|
+
Feature::OrExpr.new(requisite, blocking).simplify.should ==
|
202
|
+
Feature::EmptyFeature.new
|
203
|
+
Feature::OrExpr.new(blocking, requisite).simplify.should ==
|
204
|
+
Feature::EmptyFeature.new
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'should expand' do
|
208
|
+
a = Feature::PossibleExpr.new("A")
|
209
|
+
b = Feature::PossibleExpr.new("B")
|
210
|
+
c = Feature::PossibleExpr.new("C")
|
211
|
+
d = Feature::PossibleExpr.new("D")
|
212
|
+
and1 = Feature::AndExpr.new(a, b)
|
213
|
+
and2 = Feature::AndExpr.new(c, d)
|
214
|
+
list = Feature::OrExpr.new(and1, and2).expander.to_a
|
215
|
+
list.size.should == 2
|
216
|
+
list.should.include Feature::AndExpr.new(a, b)
|
217
|
+
list.should.include Feature::AndExpr.new(c, d)
|
218
|
+
end
|
219
|
+
|
220
|
+
it 'should be empty' do
|
221
|
+
Feature::AndExpr.new(Feature::EmptyFeature.new).should.be.empty
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
#
|
226
|
+
# test cases
|
227
|
+
#
|
228
|
+
yamlname = 'spec_feature-expr.yml'
|
229
|
+
ymlpath = File.join(File.dirname(__FILE__), yamlname)
|
230
|
+
testcases = YAML.load_file(ymlpath)
|
231
|
+
|
232
|
+
describe 'Feature::Sentence' do
|
233
|
+
it 'should get true' do
|
234
|
+
possible_a = Feature::PossibleExpr.new("A")
|
235
|
+
possible_b = Feature::PossibleExpr.new("B")
|
236
|
+
provider = Feature::OrExpr.new(possible_a, possible_b)
|
237
|
+
requisite_a = Feature::RequisiteExpr.new("A")
|
238
|
+
requisite_b = Feature::RequisiteExpr.new("B")
|
239
|
+
request = Feature::OrExpr.new(requisite_a, requisite_b)
|
240
|
+
Feature::Sentence.new(provider, request).decide.should.be.true
|
241
|
+
end
|
242
|
+
|
243
|
+
it 'should eliminate requisite feature' do
|
244
|
+
possible = Feature::PossibleExpr.new("A")
|
245
|
+
requisite = Feature::RequisiteExpr.new("A")
|
246
|
+
provider = Feature::AndExpr.new(possible)
|
247
|
+
request = Feature::AndExpr.new(requisite)
|
248
|
+
m = Feature::Sentence::EliminationMethod
|
249
|
+
result, p, r = m.eliminate_requisite_feature(provider, request)
|
250
|
+
result.should.be.true
|
251
|
+
p.should.empty
|
252
|
+
r.should.empty
|
253
|
+
end
|
254
|
+
|
255
|
+
it 'should eliminate blocking feature' do
|
256
|
+
possible = Feature::PossibleExpr.new("X")
|
257
|
+
requisite = Feature::RequisiteExpr.new("Y")
|
258
|
+
blocking = Feature::BlockingExpr.new("Z")
|
259
|
+
provider = Feature::AndExpr.new(possible)
|
260
|
+
request = Feature::AndExpr.new(requisite, blocking)
|
261
|
+
m = Feature::Sentence::EliminationMethod
|
262
|
+
result, p, r = m.eliminate_blocking_feature(provider, request)
|
263
|
+
result.should.be.true
|
264
|
+
p.should == Feature::AndExpr.new(possible)
|
265
|
+
r.should == Feature::AndExpr.new(requisite)
|
266
|
+
end
|
267
|
+
|
268
|
+
it 'should eliminate preferred feature' do
|
269
|
+
possible = Feature::PossibleExpr.new("X")
|
270
|
+
requisite = Feature::RequisiteExpr.new("Y")
|
271
|
+
preferred = Feature::PreferredExpr.new("Z")
|
272
|
+
provider = Feature::AndExpr.new(possible)
|
273
|
+
request = Feature::AndExpr.new(requisite, preferred)
|
274
|
+
m = Feature::Sentence::EliminationMethod
|
275
|
+
result, p, r = m.eliminate_preferred_feature(provider, request)
|
276
|
+
result.should.be.true
|
277
|
+
p.should == Feature::AndExpr.new(possible)
|
278
|
+
r.should == Feature::AndExpr.new(requisite)
|
279
|
+
end
|
280
|
+
|
281
|
+
it 'should eliminate or-clause including empty feature' do
|
282
|
+
possible1 = Feature::PossibleExpr.new("X")
|
283
|
+
possible2 = Feature::PossibleExpr.new("Y")
|
284
|
+
or_clause = Feature::OrExpr.new(Feature::EmptyFeature.new, possible1)
|
285
|
+
provider = Feature::AndExpr.new(or_clause, possible2)
|
286
|
+
request = Feature::AndExpr.new(Feature::EmptyFeature.new)
|
287
|
+
m = Feature::Sentence::EliminationMethod
|
288
|
+
result, p, r = m.eliminate_or_clause_including_empty_feature(provider, request)
|
289
|
+
result.should.be.true
|
290
|
+
p.should == Feature::AndExpr.new(possible2)
|
291
|
+
r.should.be.empty
|
292
|
+
end
|
293
|
+
|
294
|
+
it 'should eliminate possible feature' do
|
295
|
+
possible1 = Feature::PossibleExpr.new("X")
|
296
|
+
possible2 = Feature::PossibleExpr.new("Y")
|
297
|
+
requisite = Feature::RequisiteExpr.new("Y")
|
298
|
+
provider = Feature::AndExpr.new(possible1, possible2)
|
299
|
+
request = Feature::AndExpr.new(requisite)
|
300
|
+
m = Feature::Sentence::EliminationMethod
|
301
|
+
result, p, r = m.eliminate_possible_feature(provider, request)
|
302
|
+
result.should.be.true
|
303
|
+
p.should == Feature::AndExpr.new(possible2)
|
304
|
+
r.should == Feature::AndExpr.new(requisite)
|
305
|
+
end
|
306
|
+
|
307
|
+
testcases.each do |testname, testcase|
|
308
|
+
it "should get #{testcase["result"]}: #{testname}" do
|
309
|
+
parser = DocumentParser.new.feature_expr
|
310
|
+
provide = DocumentTransformer.new.apply(parser.parse(testcase["provide"]))
|
311
|
+
request = DocumentTransformer.new.apply(parser.parse(testcase["request"]))
|
312
|
+
Feature::Sentence.new(provide, request).decide.should == testcase["result"]
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
describe "pione method ==" do
|
318
|
+
it 'should get true' do
|
319
|
+
requisite_a = Feature::RequisiteExpr.new("X")
|
320
|
+
requisite_b = Feature::RequisiteExpr.new("X")
|
321
|
+
requisite_a.call_pione_method("==", requisite_b).should ==
|
322
|
+
PioneBoolean.true
|
323
|
+
end
|
324
|
+
|
325
|
+
it 'should get false' do
|
326
|
+
requisite_a = Feature::RequisiteExpr.new("X")
|
327
|
+
requisite_b = Feature::RequisiteExpr.new("Y")
|
328
|
+
requisite_a.call_pione_method("==", requisite_b).should ==
|
329
|
+
PioneBoolean.false
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
describe "pione method !=" do
|
334
|
+
it 'should get true' do
|
335
|
+
requisite_a = Feature::RequisiteExpr.new("X")
|
336
|
+
requisite_b = Feature::RequisiteExpr.new("Y")
|
337
|
+
requisite_a.call_pione_method("!=", requisite_b).should ==
|
338
|
+
PioneBoolean.true
|
339
|
+
end
|
340
|
+
|
341
|
+
it 'should get false' do
|
342
|
+
requisite_a = Feature::RequisiteExpr.new("X")
|
343
|
+
requisite_b = Feature::RequisiteExpr.new("X")
|
344
|
+
requisite_a.call_pione_method("!=", requisite_b).should ==
|
345
|
+
PioneBoolean.false
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
349
|
+
describe "pione method as_string" do
|
350
|
+
it 'should get string' do
|
351
|
+
requisite = Feature::RequisiteExpr.new("X")
|
352
|
+
requisite.call_pione_method("as_string").should ==
|
353
|
+
PioneString.new("+X")
|
354
|
+
blocking = Feature::BlockingExpr.new("X")
|
355
|
+
blocking.call_pione_method("as_string").should ==
|
356
|
+
PioneString.new("-X")
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
require_relative '../test-util'
|
2
|
+
|
3
|
+
describe 'Model::PioneFloat' do
|
4
|
+
before do
|
5
|
+
@one = PioneFloat.new(1.0)
|
6
|
+
@two = PioneFloat.new(2.0)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should get a ruby object that has same value' do
|
10
|
+
@one.to_ruby.should == 1.0
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should equal' do
|
14
|
+
@one.should == PioneFloat.new(1.0)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should not equal' do
|
18
|
+
@one.should.not == PioneFloat.new(2.0)
|
19
|
+
@one.should.not == PioneInteger.new(1)
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'pione method ==' do
|
23
|
+
it 'should true' do
|
24
|
+
@one.call_pione_method("==", PioneFloat.new(1.0)).should.true
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should false' do
|
28
|
+
@one.call_pione_method("==", @two).should.not.true
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should raise type error' do
|
32
|
+
should.raise(PioneModelTypeError) do
|
33
|
+
@one.call_pione_method("==", PioneInteger.new(1))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'pione method !=' do
|
39
|
+
it 'should true' do
|
40
|
+
@one.call_pione_method("!=", @two).should.true
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should false' do
|
44
|
+
@one.call_pione_method("!=", PioneFloat.new(1.0)).should.not.true
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should raise type error' do
|
48
|
+
should.raise(PioneModelTypeError) do
|
49
|
+
@one.call_pione_method("!=", PioneInteger.new(1))
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'pione method >' do
|
55
|
+
it 'should true' do
|
56
|
+
@one.call_pione_method(">", PioneFloat.new(0.0)).should.true
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should false' do
|
60
|
+
@one.call_pione_method(">", PioneFloat.new(1.0)).should.false
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should raise type error' do
|
64
|
+
should.raise(PioneModelTypeError) do
|
65
|
+
@one.call_pione_method(">", PioneInteger.new(1))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe 'pione method >=' do
|
71
|
+
it 'should true' do
|
72
|
+
@one.call_pione_method(">=", PioneFloat.new(1.0)).should.true
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'should false' do
|
76
|
+
@one.call_pione_method(">=", @two).should.false
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'should raise type error' do
|
80
|
+
should.raise(PioneModelTypeError) do
|
81
|
+
@one.call_pione_method(">=", PioneInteger.new(1))
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'pione method <' do
|
87
|
+
it 'should true' do
|
88
|
+
@one.call_pione_method("<", @two).should.true
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should false' do
|
92
|
+
@one.call_pione_method("<", PioneFloat.new(1.0)).should.false
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should raise type error' do
|
96
|
+
should.raise(PioneModelTypeError) do
|
97
|
+
@one.call_pione_method("<", PioneInteger.new(1))
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe 'pione method <=' do
|
103
|
+
it 'should true' do
|
104
|
+
@one.call_pione_method("<=", PioneFloat.new(1.0)).should.true
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'should false' do
|
108
|
+
@one.call_pione_method("<=", PioneFloat.new(0.0)).should.false
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'should raise type error' do
|
112
|
+
should.raise(PioneModelTypeError) do
|
113
|
+
@one.call_pione_method("<=", PioneInteger.new(1))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe 'pione method +' do
|
119
|
+
it 'should sum' do
|
120
|
+
@one.call_pione_method("+", @one).should == @two
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'should raise type error' do
|
124
|
+
should.raise(PioneModelTypeError) do
|
125
|
+
@one.call_pione_method("+", PioneInteger.new(1))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe 'pione method -' do
|
131
|
+
it 'should get difference' do
|
132
|
+
@two.call_pione_method("-", @one).should == @one
|
133
|
+
end
|
134
|
+
|
135
|
+
it 'should raise type error' do
|
136
|
+
should.raise(PioneModelTypeError) do
|
137
|
+
@one.call_pione_method("-", PioneInteger.new(1))
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|