rbrainfuck 0.0.1.pre.alpha.pre.3 → 0.0.1.pre.alpha.pre.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.rspec +2 -0
- data/Rakefile +4 -1
- data/rbrainfuck.gemspec +1 -0
- data/spec/rbrainfuck/interpreter_spec.rb +21 -0
- data/spec/spec_helper.rb +28 -0
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTA0MmY0NTcyOGI4MzVhY2NhMTMyM2Y4MGY2YWViNjljNTM1ZWI3Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWYzYWEzZTNhZmYzOWNlOTE3NDE4MjExMDc0ZjYxYjFhNjQ5NzYyZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTU4MDUyNWMyZDMyNTJhZGVlY2Q1ZDdiZjA0YzNkZTQ5NDcxMjcwNDNkNWE3
|
10
|
+
ODRmYzFjMGFlMjhhMzY3NTQ1MGU4YTdhMzFiODY0Nzg2NTAyNmMxNWE0MzA3
|
11
|
+
Zjk1YmI2MzI2MWIwZmY0NjFiN2E2MjA3MTFkM2EzNjBmYThhMDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWMxNmM5Y2YwMjA1NzEyYmNlOTE1ODUzMTEwYzRlYmZiNmNmZTcyZTgyODE5
|
14
|
+
NTE0ZmQ3OWUzYmFhZWU0YzY2YjU1MjA3NTczNWE4YzhmYThlMDI3MTRmNDUx
|
15
|
+
MmVhODZhM2ViZjVhMjU1NWQxMmNlMTRmM2RkZDkyNzE3ZWQxMWM=
|
data/.rspec
ADDED
data/Rakefile
CHANGED
data/rbrainfuck.gemspec
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rbrainfuck/interpreter'
|
3
|
+
|
4
|
+
describe '.allowed_chars' do
|
5
|
+
it 'return a non-empty array' do
|
6
|
+
expect(Rbrainfuck::Interpreter.allowed_chars.count).to be > 0
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#run' do
|
11
|
+
it 'print Hello World' do
|
12
|
+
bf = Rbrainfuck::Interpreter.new(30000)
|
13
|
+
bf.load('++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.')
|
14
|
+
|
15
|
+
result = capture_stdout do
|
16
|
+
bf.run
|
17
|
+
end
|
18
|
+
|
19
|
+
result.should eq("Hello World!\n")
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
3
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
4
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
5
|
+
# loaded once.
|
6
|
+
#
|
7
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
10
|
+
config.run_all_when_everything_filtered = true
|
11
|
+
config.filter_run :focus
|
12
|
+
|
13
|
+
# Run specs in random order to surface order dependencies. If you find an
|
14
|
+
# order dependency and want to debug it, you can fix the order by providing
|
15
|
+
# the seed, which is printed after each run.
|
16
|
+
# --seed 1234
|
17
|
+
config.order = 'random'
|
18
|
+
end
|
19
|
+
|
20
|
+
def capture_stdout(&block)
|
21
|
+
old_stdout = $stdout
|
22
|
+
fake_stdout = StringIO.new
|
23
|
+
$stdout = fake_stdout
|
24
|
+
block.call
|
25
|
+
fake_stdout.string
|
26
|
+
ensure
|
27
|
+
$stdout = old_stdout
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbrainfuck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.pre.alpha.pre.
|
4
|
+
version: 0.0.1.pre.alpha.pre.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Mouchet
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: A Brainfuck interpreter.
|
42
56
|
email:
|
43
57
|
- mouchet.max@gmail.com
|
@@ -47,6 +61,7 @@ extensions: []
|
|
47
61
|
extra_rdoc_files: []
|
48
62
|
files:
|
49
63
|
- .gitignore
|
64
|
+
- .rspec
|
50
65
|
- .travis.yml
|
51
66
|
- Gemfile
|
52
67
|
- LICENSE.txt
|
@@ -57,6 +72,8 @@ files:
|
|
57
72
|
- lib/rbrainfuck/interpreter.rb
|
58
73
|
- lib/rbrainfuck/version.rb
|
59
74
|
- rbrainfuck.gemspec
|
75
|
+
- spec/rbrainfuck/interpreter_spec.rb
|
76
|
+
- spec/spec_helper.rb
|
60
77
|
homepage: https://github.com/maxmouchet/rbrainfuck
|
61
78
|
licenses:
|
62
79
|
- MIT
|
@@ -81,4 +98,6 @@ rubygems_version: 2.1.11
|
|
81
98
|
signing_key:
|
82
99
|
specification_version: 4
|
83
100
|
summary: A Brainfuck interpreter.
|
84
|
-
test_files:
|
101
|
+
test_files:
|
102
|
+
- spec/rbrainfuck/interpreter_spec.rb
|
103
|
+
- spec/spec_helper.rb
|