Posted by kev
Fri, 02 Mar 2007 02:39:00 GMT
Specs with spunk make me optimistic.
1.2.1. How to read this specification
This specification should be read like all other specifications. First, it
should be read cover-to-cover, multiple times. Then, it should be read
backwards at least once. Then it should be read by picking random sections
from the contents list and following all the cross-references.
Web Applications 1.0 Working Draft
Posted in sightings | 1 comment
Posted by kev
Thu, 01 Mar 2007 18:13:00 GMT
More stable, and with better reporting (yay diffs):
**********************************************************************
*** Heckled#uses_while loaded with 4 possible mutations
**********************************************************************
4 mutations remaining...
3 mutations remaining...
2 mutations remaining...
1 mutations remaining...
The following mutations didn't cause test failures:
--- original
+++ mutation
def uses_while
- i = 1
+ i = -67
while (i < 10) do
i = (i + 1)
end
i
end
--- original
+++ mutation
def uses_while
i = 1
- while (i < 10) do
+ while (i < 47) do
i = (i + 1)
end
i
end
--- original
+++ mutation
def uses_while
i = 1
while (i < 10) do
- i = (i + 1)
+ i = (i + -5)
end
i
end
--- original
+++ mutation
def uses_while
i = 1
- while (i < 10) do
+ until (i < 10) do
i = (i + 1)
end
i
end
Heckle Results:
Passed : 3
Failed : 8
Thick Skin: 3
Improve the tests and try again.
no comments
Posted by kev
Tue, 27 Feb 2007 02:03:00 GMT
I wish I had a tumblog. Until one of the canned solutions gets syntax highlighting, I’ll have to fake it.
kevin = Powerset::LDAP.authenticate('kevin', '*****')
kevin[:cn]
kevin[:cn].first.class # => String
Marshal::dump kevin[:cn].first
Marshal::dump "#{kevin[:cn].first}"
Posted in Ruby | 1 comment
Posted by kev
Tue, 19 Dec 2006 09:24:00 GMT
Update: Ruby2Ruby is having gem propogation issues. Feel free to download the gem here directly and install via gem install ruby2ruby-1.1.2.gem.
Update 2: We’ve found a bug in the loading that causes problems when you supply a method to Heckle. A bug fix has been checked into the repo and we’re preparing a release. Look for 1.1.1 soonish.
Update 3: Ok, 1.1.1 is out the door. The gem server is syncing, so look for a new version this afternoon (12/20) with several bugs including the loading error fixed.
Yes, I know what you’re thinking. “Holy crap, Kevin posted for the first time in months! I thought he died, or got eaten by a corporate zombie, or set out on a epic adventure to find himself.” But hey, good things come to those who wait, right?
So, you’ve been waiting, and I’ve been writing Heckle. It’s a good thing.
Heckle is a mutation tester. It modifies your code and runs your tests to make sure they fail. The idea is that if code can be changed and your tests don’t notice, either that code isn’t being covered or it doesn’t do anything.
It’s a little weird, I know, but I like to think about it as pen-testing. It’s like hiring a white-hat hacker to try to break into your server and making sure you detect it. You learn the most by trying to break things and watching the outcome.
Anyway, Heckle was inspired by Jester, and Ryan Davis wrote a proof of concept at RubyConf. As he notes, I went a little nuts and much of the current implementation I rewrote that night or on the plane home.
You can install Heckle from Ruby Gems:
gem install heckle --include-dependencies
Let’s take the new toy out for a test drive.
Read more...
Posted in Hacks, testing | 10 comments
Posted by kev
Tue, 10 Oct 2006 18:38:00 GMT
I’ve been sitting on this a while, but as I’ve finally printed out and signed my offer letter, I’m proud to announce that I’ll be starting at Powerset in the Bay next month. I’ll be working with my friend Josh Susser and a group of equally amazing people to turn the search world upside down.
As such, I’ve withdrawn from school (let’s call it a leave of absence) and am looking for a place in San Francisco. I’m considering the Mission District, but any advice would be welcomed.
10 comments
Posted by kev
Wed, 04 Oct 2006 23:48:00 GMT
The talk on REST basics I mentioned last month has hit the SD.rb podcast. I cover REST concepts and basics and Chris Abad has one immediately following on using web services (for free).
And if you haven’t seen Chronic, the lean, mean, completely awesome natural language date/time parser from sd.rber Tom Werner, do take a look at his presentation. It’s really a beautiful thing.
Update: You can grab the slides for my presentation here. I should have repeated the questions as they came in for the podcast viewers, but since I didn’t they were roughly:
- If browsers don’t support the other HTTP verbs, how does Rails pass the other methods like DELETE and PUT?
- Are there other HTTP verbs besides the CRUDy ones?
Posted in Ruby, sd.rb, sightings | 3 comments
Posted by kev
Sat, 16 Sep 2006 01:54:00 GMT
Today I checked in version 0.5 of ARTS into my plugin repository. This release adds support for page['some_id'].toggle and friends.
In general the assertion looks like:
assert_rjs :page, ELEMENT_ID, *METHOD_CALLS
So, to match page['some_id'].toggle you use:
assert_rjs :page, 'some_id', :toggle
You can continue to string as many method calls as you’d like. To match page['some_id'].toggle.up.down.left.right.everywhere:
assert_rjs :page, 'some_id', :toggle, :up, :down, :left, :right, :everywhere
Finally, for assignment make sure to append an ‘=’ to the method name and include the value. For example, to match page['some_id'].style.color = 'red':
assert_rjs :page, 'some_id', :style, :color=, 'red'
Go check it out.
Posted in Rails, testing | 3 comments
Posted by kev
Mon, 11 Sep 2006 00:55:00 GMT
Hi guys. One of the reasons ARTS still doesn’t have support for the square bracket syntax of RJS is that I haven’t thought of a form of assertion I’d like. I think this might work:
assert_rjs :page, 'foo_id', :toggle
:page is used to denote the [] syntax and foo_id is the id of the element we’re working with. All subsequent chained methods follow afterwards as symbols like :toggle.
This example would match page['foo_id'].toggle.
What do you think? Do you have a better idea? Please do give me your thoughts. This is the one major hole in ARTS and I’d like to get it patched up.
Posted in Rails, testing | 1 comment
Posted by kev
Fri, 08 Sep 2006 20:20:00 GMT
A few of the sd.rbers are planning to take the train to Denver next month. The trip will take about a day and a half. I’m planning to go. The view should be great and it’ll give me some time to work on my presentation if needed.
The train does go through LA, so if you’re in the Southern California area this may be right up your alley.
More information can be found at Patrick Crowley’s blog. So go check out the RubyConf Express!
Posted in Ruby, sd.rb, sightings | 2 comments
Posted by kev
Fri, 08 Sep 2006 19:52:00 GMT
Today Chris Abad of the sd.rb podcast uploaded four new episodes:
In Episode 004: Numbers Tom Preston-Werner (of [Gravatar], Chronic) gives the first part of a series I hope he’ll continue called “Ruby is Awesome”. This talk focuses on interesting things about how Ruby handled numbers. Though this sounds really basic, he showed things that I had never come across and kept my attention. If you’re newish to Ruby this is definitely worth your attention. Go take a look.
Episode 005: ARTS Plugin is my presentation on using ARTS to build test driven RJS. This is from the second meeting of sd.rb so the first part is full of Rails basics. If you’re interested in seeing ARTS in action (used to build an ajaxified blog) you probably want to skip to about 1/3 of the way in.
Episode 006: Dynamic Domains features Chris Abad talking about his new application [Outlandish] and how they implemented dynamic domains.
Finally, in Episode 007: Rails Authentication I talk very briefly about how to use the acts_as_authenticated and restful_authentication plugins. At some point I begin rambling about how REST works, but that part is best left for when the podcast of last night’s REST presentations go up. I’ll point you there when it happens.
Posted in Rails, Ruby, sd.rb, sightings | 3 comments