rbrainfuck 0.0.1.pre.alpha.pre.3 → 0.0.1.pre.alpha.pre.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGE0Njk0YjM4MDA5MTAyY2JhM2UxZjc4OTE3ZDkzMWZmZjM5NDkyYg==
4
+ ZTA0MmY0NTcyOGI4MzVhY2NhMTMyM2Y4MGY2YWViNjljNTM1ZWI3Ng==
5
5
  data.tar.gz: !binary |-
6
- ZTIyOTk5NDRhMzdiMzI1ZmU4NDZhNzlhODVjYjA2OTcxOTlkZjA4ZA==
6
+ MWYzYWEzZTNhZmYzOWNlOTE3NDE4MjExMDc0ZjYxYjFhNjQ5NzYyZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjlhOGQ1ODk1YTQzOGZkY2RiNWRiZDQ2MGJjMzNkNzJhNDUyYTc3Y2JmM2Y0
10
- ZTAzMjFjYjZlMDE5ZmM0NTdjZjMzZTI3YzNkNWQwNGM0MzJmZGIzYzIyNGVj
11
- NmJmYzczZThiOTFhNmNlOGFhOGRhYmYwODdmMmE2YTZkZDJlNWE=
9
+ MTU4MDUyNWMyZDMyNTJhZGVlY2Q1ZDdiZjA0YzNkZTQ5NDcxMjcwNDNkNWE3
10
+ ODRmYzFjMGFlMjhhMzY3NTQ1MGU4YTdhMzFiODY0Nzg2NTAyNmMxNWE0MzA3
11
+ Zjk1YmI2MzI2MWIwZmY0NjFiN2E2MjA3MTFkM2EzNjBmYThhMDA=
12
12
  data.tar.gz: !binary |-
13
- ZTRiY2ViNTM3ZDU4NmRhMTg5NjczYzU0OTFhZTU2MjFjZGRhYmI1NmYzZDQ4
14
- ZWE3OGE0ZmMyMTkzMDU5MDcxMTQ5MTFjOWEwZGY4OTFkZWM3NmIxMzY3M2Vi
15
- NDIwNDQzMDVmZjg3ZjQzZmRmM2VkOTU4NzgzNDU5YWVlOGE5MDc=
13
+ YWMxNmM5Y2YwMjA1NzEyYmNlOTE1ODUzMTEwYzRlYmZiNmNmZTcyZTgyODE5
14
+ NTE0ZmQ3OWUzYmFhZWU0YzY2YjU1MjA3NTczNWE4YzhmYThlMDI3MTRmNDUx
15
+ MmVhODZhM2ViZjVhMjU1NWQxMmNlMTRmM2RkZDkyNzE3ZWQxMWM=
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/Rakefile CHANGED
@@ -1,3 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
2
3
 
3
- task :default do; end
4
+ RSpec::Core::RakeTask.new('spec')
5
+
6
+ task :default => :spec
data/rbrainfuck.gemspec CHANGED
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency 'bundler', '~> 1.3'
23
23
  spec.add_development_dependency 'rake'
24
+ spec.add_development_dependency 'rspec'
24
25
  end
@@ -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
@@ -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.3
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