Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kevinrutherford/reek
Browse files Browse the repository at this point in the history
Conflicts:
	Gemfile
	Gemfile.lock
	Rakefile
  • Loading branch information
kevinrutherford committed Sep 18, 2011
2 parents 8b45d74 + 395208a commit 894176d
Show file tree
Hide file tree
Showing 12 changed files with 217 additions and 229 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
@@ -0,0 +1,3 @@
rvm:
- 1.8.7
- 1.9.2
15 changes: 7 additions & 8 deletions Gemfile
@@ -1,11 +1,10 @@
source 'http://rubygems.org'
source "http://rubygems.org"

gem 'ruby_parser', "~> 2.0"
gem 'ruby2ruby', "~> 1.2"
gem 'sexp_processor', "~> 3.0"
gem "rake"
gem "sexp_processor"
gem "ruby2ruby"
gem "cucumber"
gem "gherkin", "= 2.4.11"

group :test do
gem 'rspec'
gem 'cucumber'
end
gem "rspec", "= 1.3.2"

40 changes: 18 additions & 22 deletions Gemfile.lock
Expand Up @@ -2,38 +2,34 @@ GEM
remote: http://rubygems.org/
specs:
builder (3.0.0)
cucumber (0.10.0)
cucumber (1.0.2)
builder (>= 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.3.2)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
diff-lcs (>= 1.1.2)
gherkin (~> 2.4.5)
json (>= 1.4.6)
term-ansicolor (>= 1.0.5)
diff-lcs (1.1.2)
gherkin (2.3.3)
json (~> 1.4.6)
json (1.4.6)
rspec (2.4.0)
rspec-core (~> 2.4.0)
rspec-expectations (~> 2.4.0)
rspec-mocks (~> 2.4.0)
rspec-core (2.4.0)
rspec-expectations (2.4.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.4.0)
gherkin (2.4.11)
json (>= 1.4.6)
json (1.5.3)
rake (0.9.2)
rspec (1.3.2)
ruby2ruby (1.2.5)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
ruby_parser (2.0.5)
ruby_parser (2.0.6)
sexp_processor (~> 3.0)
sexp_processor (3.0.5)
term-ansicolor (1.0.5)
term-ansicolor (1.0.6)

PLATFORMS
ruby

DEPENDENCIES
cucumber
rspec
ruby2ruby (~> 1.2)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
gherkin (= 2.4.11)
rake
rspec (= 1.3.2)
ruby2ruby
sexp_processor

14 changes: 7 additions & 7 deletions Manifest.txt
Expand Up @@ -5,16 +5,16 @@ README.md
Rakefile
bin/reek
config/defaults.reek
features/api.feature
features/masking_smells.feature
features/options.feature
features/rake_task.feature
features/reports.feature
features/ruby_api/api.feature
features/samples.feature
features/stdin.feature
features/step_definitions/reek_steps.rb
features/support/env.rb
features/yaml.feature
features/command_line_interface/options.feature
features/command_line_interface/stdin.feature
features/configuration_files/masking_smells.feature
features/rake_task/rake_task.feature
features/reports/reports.feature
features/reports/yaml.feature
lib/reek.rb
lib/reek/cli/application.rb
lib/reek/cli/command_line.rb
Expand Down
34 changes: 18 additions & 16 deletions Rakefile
@@ -1,16 +1,18 @@
require 'rake/clean'

$:.unshift File.dirname(__FILE__) + '/lib'

PROJECT_NAME = 'reek'

BUILD_DIR = 'build'; directory BUILD_DIR
PKG_DIR = "#{BUILD_DIR}/pkg"; directory PKG_DIR

GEM_MANIFEST = "Manifest.txt"
VERSION_FILE = 'lib/reek.rb'

CLOBBER.include("#{BUILD_DIR}/*")

Dir['tasks/**/*.rake'].each { |t| load t }

require 'rake/clean'

$:.unshift File.dirname(__FILE__) + '/lib'

PROJECT_NAME = 'reek'

BUILD_DIR = 'build'; directory BUILD_DIR
PKG_DIR = "#{BUILD_DIR}/pkg"; directory PKG_DIR

GEM_MANIFEST = "Manifest.txt"
VERSION_FILE = 'lib/reek.rb'

CLOBBER.include("#{BUILD_DIR}/*")

Dir['tasks/**/*.rake'].each { |t| load t }

task :default => [:test]

2 changes: 1 addition & 1 deletion features/configuration_files/masking_smells.feature
Expand Up @@ -21,7 +21,7 @@ Feature: Masking smells using config files

Scenario: corrupt config file prevents normal output
When I run reek spec/samples/corrupt_config_file
Then the exit status indicates smells
Then the exit status might indicates smells depending on your version of ruby
And it reports:
"""
spec/samples/corrupt_config_file/dirty.rb -- 7 warnings:
Expand Down
4 changes: 2 additions & 2 deletions features/reports/yaml.feature
Expand Up @@ -12,7 +12,7 @@ Feature: Report smells using simple YAML layout
Scenario: masked smells always appear
When I run reek --yaml spec/samples/masked/dirty.rb
Then the exit status indicates smells
And it reports:
And it reports this yaml:
"""
---
- !ruby/object:Reek::SmellWarning
Expand Down Expand Up @@ -65,7 +65,7 @@ Feature: Report smells using simple YAML layout
Scenario: return non-zero status when there are smells
When I pass "class Turn; end" to reek --yaml
Then the exit status indicates smells
And it reports:
And it reports this yaml:
"""
---
- !ruby/object:Reek::SmellWarning
Expand Down
314 changes: 153 additions & 161 deletions features/samples.feature

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion features/step_definitions/reek_steps.rb
Expand Up @@ -31,7 +31,11 @@
end

Then /^it reports:$/ do |report|
@last_stdout.should == report
@last_stdout.chomp.should == report.chomp
end

Then /^it reports something like: (.*)$/ do |line|
@last_stdout.chomp.should match Regexp.new(Regexp.escape(line))
end

Then /^stderr reports:$/ do |report|
Expand Down
3 changes: 0 additions & 3 deletions spec/gem/yard_spec.rb
Expand Up @@ -8,9 +8,6 @@
@stdout = `yardoc 2> #{stderr_file.path}`
@stderr = IO.read(stderr_file.path)
end
it 'succeeds silently' do
@stdout.should == ''
end
it 'raises no warnings' do
@stderr.should == ''
end
Expand Down
4 changes: 2 additions & 2 deletions spec/reek/smell_warning_spec.rb
Expand Up @@ -130,10 +130,10 @@
it_should_behave_like 'common fields'

it 'includes no subclass' do
@yaml.should match(/subclass:\s*""/)
@yaml.should match(/subclass: ''/)
end
it 'includes no source' do
@yaml.should match(/source:\s*""/)
@yaml.should match(/source: ''/)
end
it 'includes empty parameters' do
@yaml.should_not match(/parameter/)
Expand Down
7 changes: 1 addition & 6 deletions tasks/test.rake
Expand Up @@ -33,17 +33,12 @@ namespace 'test' do
t.rcov = true
end

desc 'Checks all supported versions of Ruby'
task :multiruby do
sh "multiruby -S rake spec"
end

Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format progress --color"
end

desc 'Runs all unit tests and acceptance tests'
task 'all' => ['test:spec', 'test:features', 'test:multiruby']
task 'all' => ['test:spec', 'test:features']

task 'release' => ['test:gem', 'test:all']
end
Expand Down

0 comments on commit 894176d

Please sign in to comment.