assert_value 1.4.1 → 1.5

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,59 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.8.7
5
+ - 1.9.3
6
+ - 2.2.2
7
+ - 2.2.3
8
+
9
+ gemfile: Gemfile
10
+
11
+ # Test for various gem versions we currently support
12
+ matrix:
13
+ include:
14
+ - rvm: 1.8.7
15
+ gemfile: gemfiles/old-rubies.gemfile
16
+ script:
17
+ - bundle exec rake test
18
+ - bundle exec rspec test
19
+ - rvm: 1.8.7
20
+ gemfile: gemfiles/rspec.2.99.gemfile
21
+ script: bundle exec rspec test
22
+ - rvm: 1.9.3
23
+ gemfile: gemfiles/old-rubies.gemfile
24
+ script:
25
+ - bundle exec rake test
26
+ - bundle exec rspec test
27
+ - rvm: 1.9.3
28
+ gemfile: gemfiles/rspec.2.99.gemfile
29
+ script: bundle exec rspec test
30
+ - rvm: 2.2.2
31
+ gemfile: gemfiles/rspec.2.99.gemfile
32
+ script: bundle exec rspec test
33
+ - rvm: 2.2.2
34
+ gemfile: gemfiles/minitest.4.7.5.gemfile
35
+ script: bundle exec rake test
36
+ - rvm: 2.2.2
37
+ gemfile: gemfiles/minitest.gemfile
38
+ script: bundle exec rake test
39
+ - rvm: 2.2.2
40
+ gemfile: gemfiles/test-unit.gemfile
41
+ script: bundle exec rake test
42
+ - rvm: 2.2.2
43
+ gemfile: gemfiles/rspec.gemfile
44
+ script: bundle exec rake spec
45
+ - rvm: 2.2.3
46
+ gemfile: gemfiles/rspec.2.99.gemfile
47
+ script: bundle exec rspec test
48
+ - rvm: 2.2.3
49
+ gemfile: gemfiles/minitest.4.7.5.gemfile
50
+ script: bundle exec rake test
51
+ - rvm: 2.2.2
52
+ gemfile: gemfiles/minitest.gemfile
53
+ script: bundle exec rake test
54
+ - rvm: 2.2.3
55
+ gemfile: gemfiles/test-unit.gemfile
56
+ script: bundle exec rake test
57
+ - rvm: 2.2.3
58
+ gemfile: gemfiles/rspec.gemfile
59
+ script: bundle exec rake spec
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- # gem 'minitest', '~> 5.0'
6
5
  group :development, :test do
6
+ gem 'rake'
7
7
  gem 'rspec'
8
8
  end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2011 Pluron, Inc.
1
+ Copyright (c) 2010-2015 Pluron, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -121,6 +121,8 @@ In Ruby 1.9:
121
121
 
122
122
  ## Changelog
123
123
 
124
+ - 1.5: Improve support for various testing frameworks and Ruby versions:
125
+ Ruby 2.2.2, 2.2.3, RSpec 2.x, 3.x, Test::Unit 2.x, 3.x, Minitest 4.x, 5.x
124
126
  - 1.4: Fix RSpec support
125
127
  - 1.3: Improve support for various testing frameworks, fix assertion counters
126
128
  - 1.2: Rails 4.1 and minitest gem support
data/Rakefile CHANGED
@@ -1,14 +1,17 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rdoc/task'
3
+ begin
4
+ require 'rdoc/task'
5
+ rescue LoadError
6
+ end
7
+ begin
8
+ require 'rspec/core/rake_task'
9
+ rescue LoadError
10
+ end
4
11
  require 'bundler/setup'
5
- require 'rspec/core/rake_task'
6
12
 
7
13
  Bundler::GemHelper.install_tasks
8
14
 
9
- desc 'Default: run unit tests.'
10
- task :default => :test
11
-
12
15
  desc 'Test assert_value.'
13
16
  Rake::TestTask.new(:test) do |t|
14
17
  t.libs << 'lib'
@@ -16,16 +19,28 @@ Rake::TestTask.new(:test) do |t|
16
19
  t.verbose = true
17
20
  end
18
21
 
19
- desc "Run the specs."
20
- RSpec::Core::RakeTask.new do |t|
21
- t.pattern = "test/**/*_spec.rb"
22
+ if defined?(RSpec)
23
+ desc "Run the specs."
24
+ RSpec::Core::RakeTask.new(:spec) do |t|
25
+ t.pattern = "test/**/*_spec.rb"
26
+ end
27
+ end
28
+
29
+ if defined?(RSpec) and RUBY_VERSION > '1.9.3'
30
+ desc 'Default: run specs.'
31
+ task :default => :spec
32
+ else
33
+ desc 'Default: run unit tests.'
34
+ task :default => :test
22
35
  end
23
36
 
24
- desc 'Generate documentation for assert_value.'
25
- Rake::RDocTask.new(:rdoc) do |rdoc|
26
- rdoc.rdoc_dir = 'rdoc'
27
- rdoc.title = 'assert_value'
28
- rdoc.options << '--line-numbers' << '--inline-source'
29
- rdoc.rdoc_files.include('README')
30
- rdoc.rdoc_files.include('lib/**/*.rb')
37
+ if defined?(Rake::RDocTask)
38
+ desc 'Generate documentation for assert_value.'
39
+ Rake::RDocTask.new(:rdoc) do |rdoc|
40
+ rdoc.rdoc_dir = 'rdoc'
41
+ rdoc.title = 'assert_value'
42
+ rdoc.options << '--line-numbers' << '--inline-source'
43
+ rdoc.rdoc_files.include('README')
44
+ rdoc.rdoc_files.include('lib/**/*.rb')
45
+ end
31
46
  end
data/assert_value.gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  SPEC = Gem::Specification.new do |s|
4
4
  s.name = "assert_value"
5
- s.version = "1.4.1"
5
+ s.version = "1.5"
6
6
  s.author = "Pluron, Inc."
7
7
  s.email = "support@pluron.com"
8
8
  s.homepage = "http://github.com/acunote/assert_value"
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development, :test do
4
+ gem 'rake'
5
+ gem 'minitest', '4.7.5'
6
+ gem 'test-unit-minitest'
7
+ end
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development, :test do
4
+ gem 'rake'
5
+ gem 'minitest'
6
+ end
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development, :test do
4
+ gem 'rake'
5
+ gem 'rspec'
6
+ end
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development, :test do
4
+ gem 'rake'
5
+ gem 'rspec', '~> 2.99.0'
6
+ end
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development, :test do
4
+ gem 'rake'
5
+ gem 'rspec'
6
+ end
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development, :test do
4
+ gem 'rake'
5
+ gem 'test-unit'
6
+ end
data/lib/assert_value.rb CHANGED
@@ -1,19 +1,24 @@
1
- # Copyright (c) 2010-2011 Pluron, Inc.
1
+ # Copyright (c) 2010-2015 Pluron, Inc.
2
2
 
3
- # make sure test/unit or minitest is loaded before assert_value
4
- # once Ruby 1.8 support is removed, we can replace this code
5
- # with .gemspec dependency on minitest
3
+ # there're 4 types of test frameworks we support
4
+ # 1) Test::Unit from Ruby <= 1.8.7 and Ruby >= 2.2.2
5
+ # 2) Minitest 2.x-4.x, either bundled with Ruby 1.9 - 2.1 or installed via gem
6
+ # 3) Minitest > 5.0 bundles with Ruby >= 2.2.2 or installed via gem
7
+ # 4) RSpec
6
8
  begin
7
- require 'minitest/unit'
9
+ require 'minitest/autorun' # Minitest 5.x
8
10
  rescue LoadError
9
- require 'test/unit'
11
+ begin
12
+ require 'minitest/unit' # old Minitest
13
+ rescue LoadError
14
+ begin
15
+ require 'test/unit' # Test::Unit
16
+ rescue LoadError
17
+ # RSpec only
18
+ end
19
+ end
10
20
  end
11
21
 
12
- # there're 3 types of test frameworks we support
13
- # 1) test/unit from Ruby 1.8
14
- # 2) old minitest 2.x-4.x, either bundled with Ruby 1.9 - 2.1 or installed via gem
15
- # 3) new minitest 5.x from minitest gem (required for example by Rails 4.1)
16
-
17
22
  if defined?(Minitest) and Minitest.const_defined?("VERSION") and Minitest::VERSION >= "5.0.0"
18
23
  ASSERT_VALUE_TEST_FRAMEWORK = :new_minitest
19
24
  elsif defined?(MiniTest)
@@ -21,7 +26,7 @@ elsif defined?(MiniTest)
21
26
  elsif defined?(Test)
22
27
  ASSERT_VALUE_TEST_FRAMEWORK = :test_unit
23
28
  else
24
- raise LoadError.new("Require assert_value after 'test/unit' or 'minitest/autorun'")
29
+ ASSERT_VALUE_TEST_FRAMEWORK = :rspec_only
25
30
  end
26
31
 
27
32
  require 'text_diff'
@@ -469,13 +474,17 @@ class BeSameValueAs
469
474
  end
470
475
  end
471
476
 
472
- def failure_message_for_should
477
+ def failure_message
473
478
  "expected to be the same"
474
479
  end
475
480
 
476
- def failure_message_for_should_not
481
+ def failure_message_when_negated
477
482
  "expected not to be the same"
478
483
  end
484
+
485
+ def supports_block_expectations?
486
+ true
487
+ end
479
488
  end
480
489
 
481
490
 
@@ -1,10 +1,16 @@
1
- # Copyright (c) 2011 Pluron, Inc.
1
+ # Copyright (c) 2011-2015 Pluron, Inc.
2
2
 
3
- require 'test/unit'
4
- # require 'minitest/autorun' # uncomment to test with minitest 5.x gem (enable it in Gemfile too)
5
3
  require 'assert_value'
6
4
 
7
- class AssertValueTest < ASSERT_VALUE_TEST_FRAMEWORK == :new_minitest ? Minitest::Test : Test::Unit::TestCase
5
+ test_case_class = case ASSERT_VALUE_TEST_FRAMEWORK
6
+ when :new_minitest then Minitest::Test
7
+ when :old_minitest then MiniTest::Unit::TestCase
8
+ when :test_unit then Test::Unit::TestCase
9
+ when :rspec_only then raise "This test case requires either Minitest or Test::Unit"
10
+ else raise "Unknown test framework"
11
+ end
12
+
13
+ class AssertValueTest < test_case_class
8
14
 
9
15
  def test_basic_assert_value
10
16
  assert_value "foo", <<-END
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assert_value
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: '1.5'
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Pluron, Inc.
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-08-27 00:00:00.000000000 Z
12
+ date: 2015-10-14 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: assert_value assertion
14
15
  email: support@pluron.com
@@ -16,13 +17,20 @@ executables: []
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
19
- - ".gitignore"
20
+ - .gitignore
21
+ - .travis.yml
20
22
  - Gemfile
21
23
  - LICENSE
22
24
  - README.md
23
25
  - Rakefile
24
26
  - assert_value.gemspec
25
27
  - assert_value.kdev4
28
+ - gemfiles/minitest.4.7.5.gemfile
29
+ - gemfiles/minitest.gemfile
30
+ - gemfiles/old-rubies.gemfile
31
+ - gemfiles/rspec.2.99.gemfile
32
+ - gemfiles/rspec.gemfile
33
+ - gemfiles/test-unit.gemfile
26
34
  - lib/array_diff.rb
27
35
  - lib/assert_value.rb
28
36
  - lib/minitest/assert_value_plugin.rb
@@ -34,26 +42,27 @@ files:
34
42
  homepage: http://github.com/acunote/assert_value
35
43
  licenses:
36
44
  - MIT
37
- metadata: {}
38
45
  post_install_message:
39
46
  rdoc_options: []
40
47
  require_paths:
41
48
  - lib
42
49
  required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
43
51
  requirements:
44
- - - ">="
52
+ - - ! '>='
45
53
  - !ruby/object:Gem::Version
46
54
  version: '0'
47
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
48
57
  requirements:
49
- - - ">="
58
+ - - ! '>='
50
59
  - !ruby/object:Gem::Version
51
60
  version: '0'
52
61
  requirements: []
53
62
  rubyforge_project:
54
- rubygems_version: 2.2.2
63
+ rubygems_version: 1.8.23.2
55
64
  signing_key:
56
- specification_version: 4
65
+ specification_version: 3
57
66
  summary: Assert that checks that two values (strings, expected and actual) are same
58
67
  and which can magically replace expected value with the actual in case the new behavior
59
68
  (and new actual value) is correct
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: d4ee11a14d96bed2e62ba48a26b7f2824e3b1092
4
- data.tar.gz: a7a8b98b575257c2e6bb514e47232fedaf98f8e9
5
- SHA512:
6
- metadata.gz: f1d9b8185697c532c82f3d1b8dd50c7323b87759130a8a817c1e8e3ecd1ac718b6db78126125c08929e02d4795dd8b6c9bb57ef46e093619e6e67346c32945a7
7
- data.tar.gz: a935f47a6ae4f8b3ad202c53b811ff9cd50fd162e2d49151063e691140a4c3e3efbe8489dd02ac900d56156465148bc02e9f4604f43913f3ed5c06463be1a9c2