<commit_before>plymouth
===========

(C) <NAME> (banisterfiend) 2012

_Start an interactive session when a test fails_

**Please note, this is a first release for plymouth and as such it may still have teething problems. If you encounter any quirks or crashes please file an [issue](https://github.com/banister/plymouth)**

`plymouth` is a gem to automatically start a [Pry](http://pry.github.com) session when a test fails, putting you in the context of the failure.
It currently supports [Bacon](https://github.com/chneukirchen/bacon), [Minitest](https://github.com/seattlerb/minitest), and [RSpec](https://github.com/rspec/rspec). 
Support for other testing libraries is (usually) trivial to add.

**plymouth currently only supports MRI 1.9.2+ (including 1.9.3)**

* Install the [gem](https://rubygems.org/gems/plymouth): `gem install plymouth`
* See the [source code](http://github.com/banister/plymouth)
 
**How to use:**

Simply add the following line to your test files:

`require 'plymouth'` 

`plymouth` should auto-detect which testing library you're using, and 'just work' :)


Example: Intercept a failing test in RSpec
--------

Inside the test file:

```ruby
require 'plymouth'

describe Array do
  before do
    @array = [1]
  end

  it 'should be empty' do
    @array.empty?.should == true
  end
end
```

And here is the result of running the above test with the `rspec` executable:

```ruby
Frame number: 0/14
Frame type: block

From: /Users/john/ruby/play/rspec_intercept.rb @ line 9:

     4:   before do
     5:     @array = [1]
     6:   end
     7: 
     8:   it 'should be empty' do
 =>  9:     @array.empty?.should == true
    10:   end
    11: end

[1] (pry) #<RSpec::Core::ExampleGroup::Nested_1>: 0> @array.size                                                                                                                           
=> 1
[2] (pry) #<RSpec::Core::ExampleGroup::Nested_1>: 0> ^D
F

Failures:

  1) Array should be empty
     Failure/Error: @array.empty?.should == true
       expected: true
            got: false (using ==)
     # ./rspec_intercept.rb:9:in `block (2 levels) in <top (required)>'

Finished in 7.74 seconds
1 example, 1 failure

Failed examples:

rspec ./rspec_intercept.rb:8 # Array should be empty
```

Example preamble

    puts "example code"

Limitations
-------------------------

* Occasional segfault on 1.9.3 (seems to work fine on 1.9.2). Please [report](https://github.com/banister/plymouth) all segfaults with a full backtrace!
* Only supports MRI.
* Currently limited to just Bacon, RSpec and Minitest. Support for more testing libraries will be added in the future.

Contact
-------

Problems or questions contact me at [github](http://github.com/banister)


License
-------

(The MIT License) 

Copyright (c) 2012 <NAME> (banisterfiend)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including<commit_msg>removed placeholder stuff from README<commit_after>plymouth
===========

(C) <NAME> (banisterfiend) 2012

_Start an interactive session when a test fails_

**Please note, this is a first release  (BETA)for plymouth and as such it may still have teething problems. If you encounter any quirks or crashes please file an [issue](https://github.com/banister/plymouth)**

`plymouth` is a gem to automatically start a [Pry](http://pry.github.com) session when a test fails, putting you in the context of the failure.
It currently supports [Bacon](https://github.com/chneukirchen/bacon), [Minitest](https://github.com/seattlerb/minitest), and [RSpec](https://github.com/rspec/rspec). 
Support for other testing libraries is (usually) trivial to add.

**plymouth currently only supports MRI 1.9.2+ (including 1.9.3)**

* Install the [gem](https://rubygems.org/gems/plymouth): `gem install plymouth`
* See the [source code](http://github.com/banister/plymouth)
 
**How to use:**

Simply add the following line to your test files:

`require 'plymouth'` 

`plymouth` should auto-detect which testing library you're using, and 'just work' :)


Example: Intercept a failing test in RSpec
--------

Inside the test file:

```ruby
require 'plymouth'

describe Array do
  before do
    @array = [1]
  end

  it 'should be empty' do
    @array.empty?.should == true
  end
end
```

And here is the result of running the above test with the `rspec` executable:

```ruby
Frame number: 0/14
Frame type: block

From: /Users/john/ruby/play/rspec_intercept.rb @ line 9:

     4:   before do
     5:     @array = [1]
     6:   end
     7: 
     8:   it 'should be empty' do
 =>  9:     @array.empty?.should == true
    10:   end
    11: end

[1] (pry) #<RSpec::Core::ExampleGroup::Nested_1>: 0> @array.size                                                                                                                           
=> 1
[2] (pry) #<RSpec::Core::ExampleGroup::Nested_1>: 0> ^D
F

Failures:

  1) Array should be empty
     Failure/Error: @array.empty?.should == true
       expected: true
            got: false (using ==)
     # ./rspec_intercept.rb:9:in `block (2 levels) in <top (required)>'

Finished in 7.74 seconds
1 example, 1 failure

Failed examples:

rspec ./rspec_intercept.rb:8 # Array should be empty
```

Limitations
-------------------------

* Occasional segfault on 1.9.3 (seems to work fine on 1.9.2). Please [report](https://github.com/banister/plymouth) all segfaults with a full backtrace!
* Only supports MRI.
* Currently limited to just Bacon, RSpec and Minitest. Support for more testing libraries will be added in the future.

Contact
-------

Problems or questions contact me at [github](http://github.com/banister)


License
-------

(The MIT License) 

Copyright (c) 2012 <NAME> (banisterfiend)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
{'fraction_non_alphanumeric': 0.12483443708609271, 'fraction_numerical': 0.017218543046357615, 'mean_word_length': 2.9717291255752794, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3448251', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1803, 'n_words': 686}