<commit_before># motion-stump

Stubbing and mocking for RubyMotion. Based on <NAME>'s [stump](https://github.com/jm/stump) library.

## Features

### Stubbing right on the object

```ruby
# Returns 'hey!'
MyClass.stub!(:thing, :return => "hey!")
# Returns nil
your_object.stub!(:hello)
```

### Pure stub objects
```ruby
my_stub = stub(:thing, :return => "dude, a thing!")
my_stub.thing   # => "dude, a thing!"
```

### Mocking right on the object

```ruby
my_object = "things are fun"
my_object.mock!(:fancy, :return => "ooo fancy!")
my_object.fancy # => "ooo fancy!"
my_object.mock!(:tancy, :return => "ooo fancy!")

# if my_object.tancy is not called, it will fail the spec
```

### Pure mock objects
```ruby
my_mock = mock(:hello, :return => "what fun is this?")
my_mock.hello   # => "what fun is this?"
```


### Proxying objects

```ruby
class Greeting
  def bonjour
    "Bonjour!"
  end
end

greet_me = Greeting.new
greet_me.proxy!(:bonjour)
greet_me.bonjour  # => "Bonjour!"

greet_you = Greeting.new
greet_you.proxy!(:bonjour)

# finish test...
# ! Unmet expectations: #<Greeting:0x371d24> expected bonjour
```

## Installation

```ruby
gem install 'motion-stump'
```

### Usage

Add following lines in your motion Rakefile

```ruby
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'rubygems'
require 'motion-stump'

Motion::Project::App.setup do |app|
  app.name = 'motion-stump'
end
```

## License

(The MIT License)

Copyright © 2012 <NAME><commit_msg>remove proxy object docs -- as they seems not working yet<commit_after># motion-stump

Stubbing and mocking for RubyMotion. Based on <NAME>'s [stump](https://github.com/jm/stump) library.

## Features

### Stubbing right on the object

```ruby
# Returns 'hey!'
MyClass.stub!(:thing, :return => "hey!")
# Returns nil
your_object.stub!(:hello)
```

### Pure stub objects
```ruby
my_stub = stub(:thing, :return => "dude, a thing!")
my_stub.thing   # => "dude, a thing!"
```

### Mocking right on the object

```ruby
my_object = "things are fun"
my_object.mock!(:fancy, :return => "ooo fancy!")
my_object.fancy # => "ooo fancy!"
my_object.mock!(:tancy, :return => "ooo fancy!")

# if my_object.tancy is not called, it will fail the spec
```

### Pure mock objects
```ruby
my_mock = mock(:hello, :return => "what fun is this?")
my_mock.hello   # => "what fun is this?"
```


## Installation

```ruby
gem install 'motion-stump'
```

### Usage

Add following lines in your motion Rakefile

```ruby
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'rubygems'
require 'motion-stump'

Motion::Project::App.setup do |app|
  app.name = 'motion-stump'
end
```

## License

(The MIT License)

Copyright © 2012 <NAME>
{'fraction_non_alphanumeric': 0.1733677609738104, 'fraction_numerical': 0.005164146071560309, 'mean_word_length': 4.661795407098121, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1478950', 'n_tokens_mistral': 1046, 'n_tokens_neox': 966, 'n_words': 279}