lucid 0.3.0 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f6ab1b9e2bd7bdabc5f6190c735f385d635a538
4
- data.tar.gz: ff6d239bc7d8e5d962c8b19de35a8e44ea9199a3
3
+ metadata.gz: b01bc3ff174ec61a65f17cfb82cc08d924a4a10e
4
+ data.tar.gz: 45c1a13af33973644456fdb92fe08a3c7878b936
5
5
  SHA512:
6
- metadata.gz: f45cfb6e7b5cea2e9ae16e580df9007f08156c92904eb88247ab5186ecad39b1bf7f29c187a14c14ebb8e7a16cccf927810b0e4e245f3bece110e7c5afe3bc0d
7
- data.tar.gz: 33f231e265a202d24de4f770d23bace5695f8de362b15cd35ccab38662ef895f194b16c09e969845b4a15e5b77702e7a088a82812bbbf614a252f1434ac55b08
6
+ metadata.gz: 3df8d6b4f7e87deabbe95b6a5ef1bfa2d8bae7241e6d4627b20ca92c9598da4c6f33928d813ca640e8c902861ef3b66e53aae3a398cef09be8ba5b28827b418f
7
+ data.tar.gz: d8f0da9e0190bfb05f27bd3b61cf8748608f3efd02d7a262ac78e9253d36f4cf74a6b6cfec93d1692b8dc44888f230a12dde78a9e1e5ac12d07fa94f5b590a6f
data/.gitignore CHANGED
@@ -1,3 +1,11 @@
1
+ *.gem
2
+ *.rbc
3
+ *.pyc
4
+ *.tgz
5
+ *.swp
6
+ *.swo
7
+ *.log
8
+ *.pid
1
9
  .eprj
2
10
  .idea
3
11
  .rvmrc
@@ -7,6 +15,7 @@
7
15
  .tmtags
8
16
  .DS_Store
9
17
  .sass-cache
18
+ .rubocop.yml
10
19
  Gemfile.lock
11
20
  pkg
12
21
  doc
@@ -22,16 +31,7 @@ InstalledFiles
22
31
  lib/bundler/man
23
32
  test/version_tmp
24
33
  rerun.txt
25
- *.log
26
- *.pid
27
34
  *~
28
- *.swp
29
- *.swo
30
35
  *.tmproj
31
36
  .#*
32
- *.pyc
33
- *.rbc
34
37
  ._*
35
- *.tgz
36
- *.gem
37
- *.rbc
@@ -1,8 +1,9 @@
1
- script: "rake"
1
+ language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0.0
5
4
  - 1.9.3
5
+ - 2.0.0
6
+ - 2.1.0
6
7
 
7
8
  branches:
8
9
  only:
data/Gemfile CHANGED
@@ -1,8 +1,6 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- # All gem dependencies are specified in lucid.gemspec
4
- gemspec
5
-
6
- # gem 'gherkin', :path => '../gherkin'
3
+ gem 'simplecov', '>= 0.8.0', '< 1.0'
4
+ gem 'coveralls', require: false
7
5
 
8
- gem 'coveralls', require: false
6
+ gemspec
data/HISTORY.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Change Log and History
2
2
  ======================
3
3
 
4
+ Version 0.3.3 / 2013-02-13
5
+ --------------------------
6
+
7
+ This patch release reverts patch releases 0.3.1 and 0.3.2. Both of those patches were put in place to start on a different execution mode for Lucid. That execution mode, however, has proven more problematic than I would have preferred. Patch 0.3.3 essentially puts Lucid back to 0.3.0, albeit with a few structural enhancements.
8
+
4
9
  Version 0.3.0 / 2013-11-05
5
10
  --------------------------
6
11
 
@@ -16,7 +21,7 @@ The project generator for creating Fluent projects has been updated. The main ch
16
21
  Version 0.2.1 / 2013-10-21
17
22
  --------------------------
18
23
 
19
- This is a small patch release. The patch is in the project generator. The [Symbiont](https://github.com/jnyman/symbiont) test framework is being deprecated in favor of [Fluent](https://github.com/jnyman/fluent). The project generator has been updated accordingly.
24
+ This is a small patch release. The patch is in the project generator. The [Symbiont](https://github.com/jnyman/symbiont) test framework is being deprecated in favor of [Fluent](https://github.com/jnyman/fluent). The project generator has been updated accordingly.
20
25
 
21
26
 
22
27
  Version 0.2.0 / 2013-09-28
@@ -106,4 +111,4 @@ This is very much an alpha release to determine how feasible Lucid is as a tool.
106
111
  Versions 0.0.1 to 0.0.4
107
112
  -----------------------
108
113
 
109
- These initial versions of Lucid were designed to serve as nothing more than a wrapper for Cucumber. The goal was to allow for an easier way to work around the opinionated nature of tools like Cucumber in terms of how they expected your projects to be setup.
114
+ These initial versions of Lucid were designed to serve as nothing more than a wrapper for Cucumber. The goal was to allow for an easier way to work around the opinionated nature of tools like Cucumber in terms of how they expected your projects to be setup.
data/README.md CHANGED
@@ -2,14 +2,16 @@ Lucid
2
2
  =====
3
3
 
4
4
  [![Build Status](https://secure.travis-ci.org/jnyman/lucid.png)](http://travis-ci.org/jnyman/lucid)
5
+ [![Coverage Status](https://coveralls.io/repos/jnyman/lucid/badge.png?branch=master)](https://coveralls.io/r/jnyman/lucid)
6
+ [![Code Climate](https://codeclimate.com/github/jnyman/lucid.png)](https://codeclimate.com/github/jnyman/lucid)
5
7
  [![Dependency Status](https://gemnasium.com/jnyman/lucid.png)](https://gemnasium.com/jnyman/lucid)
6
8
  [![Gem Version](https://badge.fury.io/rb/lucid.png)](http://badge.fury.io/rb/lucid)
7
- [![Coverage Status](https://coveralls.io/repos/jnyman/lucid/badge.png?branch=master)](https://coveralls.io/r/jnyman/lucid)
9
+
8
10
 
9
11
  Description
10
12
  -----------
11
13
 
12
- Lucid is a Test Description Language (TDL) execution engine. It is, in many ways, a clone of the popular tool [Cucumber](http://cukes.info/). Lucid is diverging in many ways from Cucumber and similar tools but it does owe much of its initial structure to them.
14
+ Lucid is a Test Description Language (TDL) specification and execution engine. It is a clone of the popular tool [Cucumber](http://cukes.info/). Lucid is diverging in many ways from Cucumber but it does owe much of its initial structure to it. Lucid will also be incorporating some of the good ideas that have come to light in tools like [Spinach](https://github.com/codegram/spinach) and [Turnip](https://github.com/jnicklas/turnip).
13
15
 
14
16
  This is an alpha release of Lucid as it strives to become its own entity in the world of BDD tools.
15
17
 
@@ -41,7 +43,7 @@ In order to to check what options are available to you from the command line, do
41
43
 
42
44
  $ lucid --help
43
45
 
44
- You should also check out some of my [blog posts related to Lucid](http://testerstories.com/?cat=24). They will take you through workflows of using the tool.
46
+ You should also check out some of my [blog posts related to Lucid](http://testerstories.com/category/lucid/). They will take you through various aspects of using the framework.
45
47
 
46
48
 
47
49
  Contributing
@@ -51,8 +53,8 @@ Contributing
51
53
 
52
54
  To work on Lucid:
53
55
 
54
- 1. Fork the project.
55
- 2. Create your feature branch (`git checkout -b my-new-feature`)
56
- 3. Commit your changes (`git commit -am 'Add some feature'`)
57
- 4. Push to the branch (`git push origin my-new-feature`)
58
- 5. Create a new [pull request](https://help.github.com/articles/using-pull-requests)
56
+ 1. [Fork the project](http://gun.io/blog/how-to-github-fork-branch-and-pull-request/).
57
+ 2. Create a feature branch. (`git checkout -b my-new-feature`)
58
+ 3. Commit your changes. (`git commit -am 'new feature'`)
59
+ 4. Push the branch. (`git push origin my-new-feature`)
60
+ 5. Create a new [pull request](https://help.github.com/articles/using-pull-requests).
data/Rakefile CHANGED
@@ -2,10 +2,15 @@
2
2
  require 'bundler/gem_tasks'
3
3
  require 'rspec/core/rake_task'
4
4
 
5
- RSpec::Core::RakeTask.new do |c|
6
- options = ['--color']
7
- options += ['--format', 'documentation']
8
- c.rspec_opts = options
5
+ namespace :spec do
6
+ RSpec::Core::RakeTask.new(:all) do |config|
7
+ options = %w(--color)
8
+ options += %w(--format documentation)
9
+ options += %w(--format html --out spec/reports/unit-test-report.html)
10
+ options += %w(--format nested --out spec/reports/unit-test-report.txt)
11
+
12
+ config.rspec_opts = options
13
+ end
9
14
  end
10
15
 
11
- task :default => :spec
16
+ task default: %w(spec:all)
data/bin/lucid CHANGED
@@ -1,9 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- app_lib = File.expand_path('../lib', File.dirname(__FILE__))
4
- $LOAD_PATH.unshift(app_lib) unless $LOAD_PATH.include?(app_lib)
3
+ $LOAD_PATH << File.dirname(__FILE__) + '/../lib'
5
4
 
6
- require 'lucid/rspec/disallow_options'
7
5
  require 'lucid/cli/app'
8
6
 
9
7
  Lucid::CLI::App.new(ARGV.dup).start!
@@ -9,7 +9,7 @@ module Lucid
9
9
  class ProfileNotFound < StandardError; end
10
10
 
11
11
  class Configuration
12
- include ObjectFactory
12
+ include Factory
13
13
 
14
14
  attr_reader :out_stream
15
15
 
@@ -1,37 +1,37 @@
1
1
  module Lucid
2
- module ObjectFactory #:nodoc:
3
- def create_object_of(phrase)
4
- try = 0
5
- begin
6
- try += 1
7
- names = phrase.split('::')
8
- names.shift if names.empty? || names.first.empty?
2
+ module Factory
3
+ # @param type [String] Object representation
4
+ def create_object_of(type)
5
+ require path_for_type(type)
9
6
 
10
- constant = ::Object
11
- names.each do |name|
12
- constant = provide_object_name(constant, name)
13
- end
14
- constant
15
- rescue NameError => e
16
- require underscore(phrase)
17
- if try < 2
18
- retry
19
- else
20
- raise e
21
- end
7
+ names = parse_type(type)
8
+ constant = ::Object
9
+
10
+ names.each do |name|
11
+ constant = provide_object_name(constant, name)
22
12
  end
23
- end
24
13
 
25
- def underscore(phrase)
26
- phrase.to_s.gsub(/::/, '/').
27
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
28
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
29
- tr("-", "_").
30
- downcase
14
+ constant
31
15
  end
32
16
 
33
17
  private
34
18
 
19
+ def path_for_type(type)
20
+ type.to_s.gsub(/::/, '/')
21
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
22
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
23
+ .tr('-', '_')
24
+ .downcase
25
+ end
26
+
27
+ def parse_type(type)
28
+ names = type.split('::')
29
+ names.shift if names.empty? || names.first.empty?
30
+ names
31
+ end
32
+
33
+ # @param constant [Object] class or module reference
34
+ # @param name [String] class or module reference
35
35
  def provide_object_name(constant, name)
36
36
  if constant.const_defined?(name, false)
37
37
  constant.const_get(name, false)
@@ -2,7 +2,7 @@ require 'rbconfig'
2
2
 
3
3
  module Lucid
4
4
  unless defined?(Lucid::VERSION)
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.3'
6
6
  BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/lucid')
7
7
  LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib')
8
8
  JRUBY = defined?(JRUBY_VERSION)
@@ -27,7 +27,7 @@ module Lucid
27
27
  end
28
28
  end
29
29
 
30
- include ObjectFactory
30
+ include Factory
31
31
 
32
32
  def initialize(user_interface, configuration={})
33
33
  @configuration = Configuration.parse(configuration)
@@ -1,43 +1,53 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  require 'lucid/platform'
6
6
 
7
- Gem::Specification.new do |gem|
8
- gem.name = 'lucid'
9
- gem.version = Lucid::VERSION
10
- gem.author = 'Jeff Nyman'
11
- gem.description = 'Test Description Language Execution Engine'
12
- gem.summary = "lucid-#{gem.version}"
13
- gem.email = 'jeffnyman@gmail.com'
14
- gem.license = 'MIT'
15
- gem.homepage = 'https://github.com/jnyman/lucid'
16
- gem.platform = Gem::Platform::RUBY
17
-
18
- gem.required_ruby_version = '>= 1.9.3'
19
- gem.rubygems_version = '>= 1.6.1'
20
-
21
- gem.add_runtime_dependency 'thor', '>= 0.18.1'
22
- gem.add_runtime_dependency 'builder', '>= 2.1.2'
23
- gem.add_runtime_dependency 'diff-lcs', '>= 1.1.3'
24
- gem.add_runtime_dependency 'gherkin', '>= 2.12.0'
25
- gem.add_runtime_dependency 'multi_json', '>= 1.8.0', '< 2.0'
26
-
27
- gem.add_development_dependency 'rspec', '>= 2.14'
28
- gem.add_development_dependency 'simplecov', '>= 0.7.1'
29
-
30
- gem.post_install_message = %{
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'lucid'
9
+ spec.version = Lucid::VERSION
10
+ spec.author = 'Jeff Nyman'
11
+ spec.email = 'jeffnyman@gmail.com'
12
+ spec.summary = %q{Test Description Language Specification and Execution Engine}
13
+ spec.description = <<-EOF
14
+ Lucid is a test framework that is designed to treat testing as a
15
+ design activity by allowing requirements to be defined as tests.
16
+ Those tests can then be executed via an automation layer. This is
17
+ the basis of creating executable specifications.
18
+ EOF
19
+ spec.homepage = 'https://github.com/jnyman/lucid'
20
+ spec.licenses = %w(MIT)
21
+ spec.platform = Gem::Platform::RUBY
22
+
23
+ spec.files = `git ls-files -z`.split("\x0")
24
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
25
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
26
+ spec.require_paths = %w(lib)
27
+
28
+ spec.required_ruby_version = '>= 1.9.3'
29
+ spec.required_rubygems_version = '>= 1.6.1'
30
+
31
+ spec.add_development_dependency 'bundler', '~> 1.5'
32
+ spec.add_development_dependency 'rake'
33
+
34
+ spec.add_runtime_dependency 'builder', '>= 3.2.2'
35
+ spec.add_runtime_dependency 'multi_json', '>= 1.8.0', '< 2.0'
36
+ spec.add_runtime_dependency 'gherkin', '>= 2.12.0'
37
+ spec.add_runtime_dependency 'rspec', '>= 2.14'
38
+
39
+ spec.post_install_message = %{
31
40
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
32
41
 
33
- Thanks for installing Lucid #{Lucid::VERSION}.
42
+ Lucid #{Lucid::VERSION} has been installed.
43
+
44
+ Run the following command to get help:
45
+ lucid --help
46
+
47
+ Information on Lucid can be found under the 'lucid'
48
+ category at:
49
+ http://testerstories.com/category/lucid/
34
50
 
35
51
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
36
52
  }
37
-
38
- gem.files = `git ls-files`.split($/)
39
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
40
- gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
41
- gem.rdoc_options = ["--charset=UTF-8"]
42
- gem.require_paths = %w(lib)
43
53
  end
@@ -16,11 +16,11 @@ module Lucid
16
16
  describe 'start' do
17
17
  context 'passed a runtime' do
18
18
  let(:runtime) { double('runtime').as_null_object }
19
-
19
+
20
20
  def do_start
21
21
  subject.start!(runtime)
22
22
  end
23
-
23
+
24
24
  it 'configures the runtime' do
25
25
  configuration = double('Configuration').as_null_object
26
26
  Configuration.stub(:new => configuration)
@@ -28,7 +28,7 @@ module Lucid
28
28
  kernel.should_receive(:exit).with(1)
29
29
  do_start
30
30
  end
31
-
31
+
32
32
  it 'uses that runtime for running and reporting results' do
33
33
  results = double('results', :failure? => true)
34
34
  runtime.should_receive(:run)
@@ -55,7 +55,7 @@ module Lucid
55
55
  end
56
56
  end
57
57
  end
58
-
58
+
59
59
  describe 'verbose execution' do
60
60
  before(:each) do
61
61
  b = Lucid::Parser::TDLBuilder.new('specs/test.spec')
@@ -77,35 +77,18 @@ module Lucid
77
77
  end
78
78
  end
79
79
 
80
- describe '--format with a formatter' do
81
- it 'should fail if it cannot resolve a Formatter class' do
82
- cli = App.new(%w{--format ZooModule::MonkeyFormatterClass}, stdin, stdout, stderr, kernel)
83
- mock_module = double('module')
84
- Object.stub(:const_defined?).and_return(true)
85
- mock_module.stub(:const_defined?).and_return(true)
86
-
87
- f = double('formatter').as_null_object
88
-
89
- Object.should_receive(:const_get).with('ZooModule', false).and_return(mock_module)
90
- mock_module.should_receive(:const_get).with('MonkeyFormatterClass', false).and_return(double('formatter class', :new => f))
91
-
92
- kernel.should_receive(:exit).with(1)
93
- cli.start!
94
- end
95
- end
96
-
97
80
  describe 'handling exceptions' do
98
81
  [ProfilesNotDefinedError, YmlLoadError, ProfileNotFound].each do |exception_class|
99
82
  it "rescues #{exception_class}, prints the message to the error stream" do
100
83
  Configuration.stub(:new).and_return(configuration = double('configuration'))
101
84
  configuration.stub(:parse).and_raise(exception_class.new('error message'))
102
-
85
+
103
86
  subject.start!
104
87
  stderr.string.should == "error message\n"
105
88
  end
106
89
  end
107
90
  end
108
-
91
+
109
92
  end
110
93
  end
111
- end
94
+ end
@@ -1,8 +1,8 @@
1
1
  require_relative '../spec_helper'
2
2
 
3
3
  module Lucid
4
- describe ObjectFactory do
5
- include ObjectFactory
4
+ describe Factory do
5
+ include Factory
6
6
 
7
7
  it 'should load a valid formatter' do
8
8
  generated_class = create_object_of('Lucid::Formatter::Html')
@@ -13,4 +13,4 @@ module Lucid
13
13
  expect { create_object_of('Lucid::Formatter::Testing') }.to raise_error(LoadError)
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -1,6 +1,8 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
 
3
+ require 'simplecov'
3
4
  require 'coveralls'
5
+
4
6
  Coveralls.wear!
5
7
 
6
8
  SimpleCov.add_filter '/spec'
@@ -10,10 +12,11 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
10
12
  Coveralls::SimpleCov::Formatter
11
13
  ]
12
14
 
13
- SimpleCov.at_exit do
14
- SimpleCov.result.format!
15
- SimpleCov.minimum_coverage 60
16
- SimpleCov.maximum_coverage_drop 5
15
+ SimpleCov.start do
16
+ add_filter '/spec'
17
+ coverage_dir "#{SimpleCov.root}/spec/reports/coverage"
18
+ minimum_coverage 70
19
+ maximum_coverage_drop 5
17
20
  end
18
21
 
19
- require 'lucid'
22
+ require 'lucid'