Skip to content

Add penup, pendown, text and font commands #93

Merged
merged 3 commits into from Dec 28, 2013

3 participants

@aunderwo

No description provided.

@aunderwo aunderwo referenced this pull request Nov 24, 2012
Closed

penup and pendown #65

@deadprogram
The Hybrid Group member

The penup and pendown methods are also Hackety-Hack compatible, and the Turtle#text and Turtle#font commands are extensions supported by the js lib we actually use for the turtle, so this seems like a good idea.

Can you please add some tests to https://github.com/hybridgroup/kidsruby/blob/master/spec/lib/turtle_spec.rb for your new methods, and then I can accept the PR.

Thanks for doing it, this will be a good thing.

@aunderwo

Added the tests but couldn't get any tests to run via rake test.

Error messages were
Errno::ECONNREFUSED: Connection refused - connect(2)

@deadprogram
The Hybrid Group member

I will look into this... what OS are and Ruby version are you running?

@hunterboerner

Are we still interested in merging this?

@hunterboerner

This has been opened for about a year now, is this still something we are wanting to merge and haven't already implemented? If so, @aunderwo, could you get this ready to merge by updating your branch?

EDIT: It hasn't, I just thought there was something similar.

@deadprogram
The Hybrid Group member

I want this feature too! @hunterboerner maybe you can help get the branch up to date, if @aunderwo is busy.

@hunterboerner

Well.... I have the pr/93 branch now with all the changes and it's up to date... is there a way I can add commits onto this PR or will that require 1.21 gigawatts?

@deadprogram
The Hybrid Group member

You should be able to merge the pr/93 branch into the aunderwo:master branch, or else close this PR and open a new one based on pr/93. No deloreans needed, afaik 😁

@hunterboerner

aunderwo:master isn't on this repo, it's on his forked one so I don't see where I would have access to that.

@deadprogram
The Hybrid Group member

@hunterboerner seems like best bet is to merge your pr/93 branch into master, which might just close this PR, and if not, we can make it closed manually.

@hunterboerner

Ok then merge master, do your thing :)

@deadprogram
The Hybrid Group member

When I checked out the pr/93 branch and ran tests, I received 2 failures:

ron@ron-Dell-System-XPS-L322X:~/Development/kidsruby/kidsruby (pr/93)
$ bundle exec rake test
(in /home/ron/Development/kidsruby/kidsruby)
/home/ron/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -I"lib:test" "/home/ron/.rvm/gems/ruby-1.9.2-p290@kidsruby2/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/lib/turtle_test.rb" "test/lib/rubywarrior_test.rb" "test/lib/dialogs_test.rb" "test/main_test.rb" "test/models/languages_test.rb" "test/models/stdin_rejecter_test.rb" "test/models/runner_writer_test.rb" "test/models/std_io_test.rb" "test/models/inverts_theme_test.rb" "test/models/frame_writer_test.rb" 
Run options: --seed 39192

# Running tests:

...............................F....F..............

Finished tests in 0.135015s, 377.7349 tests/s, 503.6465 assertions/s.

  1) Failure:
test_0011_must_be_able_to_pen_up(Turtle::when properly initialized) [test/lib/turtle_test.rb:113]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Turtle:0x32bffb8>.send_commands(any_parameters)
satisfied expectations:
- allowed any number of times, invoked once: #<Mock:interface>.call('init_turtle')
- allowed any number of times, invoked once: #<Mock:interface>.valid?(any_parameters)
- allowed any number of times, invoked once: #<Mock:reply>.valid?(any_parameters)
- allowed any number of times, invoked once: #<AnyInstance:InterfaceHelper>.get_interface(any_parameters)
- expected exactly once, invoked once: #<Turtle:0x32bffb8>.add_command(any_parameters)


  2) Failure:
test_0012_must_be_able_to_pen_down(Turtle::when properly initialized) [test/lib/turtle_test.rb:119]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Turtle:0x2fc3878>.send_commands(any_parameters)
satisfied expectations:
- allowed any number of times, invoked once: #<Mock:interface>.call('init_turtle')
- allowed any number of times, invoked once: #<Mock:interface>.valid?(any_parameters)
- allowed any number of times, invoked once: #<Mock:reply>.valid?(any_parameters)
- allowed any number of times, invoked once: #<AnyInstance:InterfaceHelper>.get_interface(any_parameters)
- expected exactly once, invoked once: #<Turtle:0x2fc3878>.add_command(any_parameters)


51 tests, 68 assertions, 2 failures, 0 errors, 0 skips

@hunterboerner did you have that problem?

@hunterboerner

Oh yes, tests -.-. Fixing that problem now.

@hunterboerner

I think it has to do with line 113 and 119 in turtle_test.rb

@turtle.expects(:send_commands)

That shouldn't be there for the penup/down command.

@hunterboerner

@deadprogram, try it now on pr/93 branch.

@deadprogram deadprogram merged commit a453b9f into hybridgroup:master Dec 28, 2013
@deadprogram
The Hybrid Group member

All green now. I merged with master.

@hunterboerner

Uh... you merged his branch now the pr/93 branch...

@aunderwo

Sorry a bit late to the thread. Been busy over the Christmas period. The reason I never merged the pen up/down into the main branch was because I have no real experience of writing tests and wasn't sure of where to start. Thanks everybody for revisiting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.