Skip to content

Commit 7f11608

Browse files
committed
feat: improve readme and add rake task
1 parent a056944 commit 7f11608

File tree

4 files changed

+31
-22
lines changed

4 files changed

+31
-22
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
source "https://rubygems.org"
22

3+
gem 'rake'
4+
gem 'minitest'
35
gem 'rx_ruby'
46
gem 'event_emitter'

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
event_emitter (0.2.5)
5+
minitest (5.8.3)
6+
rake (10.4.2)
57
rx_ruby (0.0.2)
68

79
PLATFORMS
810
ruby
911

1012
DEPENDENCIES
1113
event_emitter
14+
minitest
15+
rake
1216
rx_ruby
1317

1418
BUNDLED WITH

README.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ Any response for Node with a version number greater than 0.10.x is fine.
2525

2626
To install the RxRuby Koans, download via Git and add the depdencies via NPM:
2727
```bash
28-
$ git clone https://github.com/Reactive-Extensions/RxRubyKoans.git
28+
$ git clone https://github.com/fteem/RxRubyKoans.git
2929
$ cd RxRubyKoans
3030
[RxRubyKoans ]$ npm install
3131
```
3232

3333
## The Path to Enlightenment ##
3434

35-
You can run the tests by calling `npm test` at your terminal window.
35+
You can run the tests by calling `rake` at your terminal window.
3636
```bash
37-
[RxRubyKoans] $ npm test
37+
[RxRubyKoans] $ rake
3838
```
3939

4040
## Red, Green, Refactor ##
@@ -52,12 +52,13 @@ The very first time you run it you will see the following output:
5252
Error: expected 42 to equal undefined
5353
```
5454

55-
You have come to the first error. You then open up the `about_streams.js` file in your text editor and look at `simple subscription`:
55+
You have come to the first error. You then open up the `about_streams.rb` file in your text editor and look at `simple subscription`:
5656

57-
```js
58-
test('simple subscription', function () {
59-
Observable.just(42).subscribe(function (x) { equal(x, __); });
60-
});
57+
```rb
58+
def test_simple_subscription
59+
stream = RxRuby::Observable.just(42)
60+
stream.subscribe {|x| assert_equal(__, x) }
61+
end
6162
```
6263

6364
You then change `__` to `42` and run the tests again. You should now have fixed the error.
@@ -66,18 +67,7 @@ Before moving on, think about what you are learning.
6667

6768
In this specific case, ignore everything except the method name and the parts inside the method. The goal is for you to see that if you pass a value to the proper assertion method method, it will either ensure it is true and continue on, or fail if in fact the statement is false.
6869

69-
## License ##
70+
## Note
7071

71-
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
72-
73-
Licensed under the Apache License, Version 2.0 (the "License"); you
74-
may not use this file except in compliance with the License. You may
75-
obtain a copy of the License at
76-
77-
http://www.apache.org/licenses/LICENSE-2.0
78-
79-
Unless required by applicable law or agreed to in writing, software
80-
distributed under the License is distributed on an "AS IS" BASIS,
81-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
82-
implied. See the License for the specific language governing permissions
83-
and limitations under the License.
72+
These koans have been ripped off from [RxJSKoans](https://github.com/Reactive-Extensions/RxJSKoans)
73+
and translated to Ruby. Ping me [@fteem](https://twitter.com/fteem) for any feedback, questions or complaints.

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'rake/testtask'
2+
3+
task :test do
4+
Rake::TestTask.new do |t|
5+
t.libs << "test"
6+
t.test_files = FileList['test/*_about_*.rb']
7+
t.verbose = true
8+
end
9+
end
10+
11+
task :default => :test
12+
13+

0 commit comments

Comments
 (0)